{"raw_statement":[{"iden":"problem statement","content":"We have an integer sequence $A$, whose length is $N$.\nFind the number of the non-empty **contiguous** subsequences of $A$ whose sums are $0$. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken from different positions."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $-10^9 \\leq A_i \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $...$ $A_N$"},{"iden":"sample input 1","content":"6\n1 3 -4 2 2 -2"},{"iden":"sample output 1","content":"3\n\nThere are three contiguous subsequences whose sums are $0$: $(1,3,-4)$, $(-4,2,2)$ and $(2,-2)$."},{"iden":"sample input 2","content":"7\n1 -1 1 -1 1 -1 1"},{"iden":"sample output 2","content":"12\n\nIn this case, some subsequences that have the same contents but are taken from different positions are counted individually. For example, three occurrences of $(1, -1)$ are counted."},{"iden":"sample input 3","content":"5\n1 -2 3 -4 5"},{"iden":"sample output 3","content":"0\n\nThere are no contiguous subsequences whose sums are $0$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}