{"raw_statement":[{"iden":"problem statement","content":"You are given an integer sequence of length $N$ consisting of $0$ and $1$: $A=(A_1,A_2,\\cdots,A_N)$.\nYou will do the operation below exactly once.\n\n*   Choose a **contiguous** subsequence of $A$ and flip the elements in it: convert $0$ to $1$ and vice versa. Here, you may choose an empty subsequence, in which case the elements of $A$ do not change.\n\nYour score will be the number of $1$'s in $A$. How many values are there that your score can take?"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 3 \\times 10^5$\n*   $0 \\leq A_i \\leq 1$\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$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4\n0 1 1 0"},{"iden":"sample output 1","content":"4\n\nThere are four possible values for your score: $0, 1, 2, 3$. For example, if you flip the $2$\\-nd through $4$\\-th elements of $A$, you will get $A=(0,0,0,1)$, for a score of $1$."},{"iden":"sample input 2","content":"5\n0 0 0 0 0"},{"iden":"sample output 2","content":"6"},{"iden":"sample input 3","content":"6\n0 1 0 1 0 1"},{"iden":"sample output 3","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}