{"raw_statement":[{"iden":"problem statement","content":"There is an integer sequence $A=(A_1,A_2,\\dots,A_N)$ of length $N$ consisting of $0$ and $1$. You are given $Q$ queries. The $q$\\-th query is as follows:\n\n*   An integer $i_q$ between $1$ and $N$ is given. Change $A_{i_q}$ to $1$ if it is $0$, and to $0$ if it is $1$.\n\nAfter processing each query, find the answer to the following problem:\n\n> Consider sequences $B=(B_1,B_2,\\dots,B_{|B|})$ consisting of $0$ and $1$ that satisfy the following condition:\n> \n> *   By performing the following operation any number of times on $B$, it can be made to match sequence $A$:\n>     *   Choose an integer $i$ between $1$ and $|B|-1$, inclusive.\n>     *   Insert $B_i\\oplus B_{i+1}$ between $B_i$ and $B_{i+1}$.\n> \n> It can be proved that there always exists a $B$ that satisfies the condition. Find the minimum possible value of $|B|$."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq A_i \\leq 1$\n*   $1 \\leq Q \\leq 5 \\times 10^5$\n*   $1 \\leq i_q \\leq N$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n$Q$\n$i_1$\n$i_2$\n$\\vdots$\n$i_Q$"},{"iden":"sample input 1","content":"3\n0 0 0\n2\n1\n2"},{"iden":"sample output 1","content":"3\n2\n\nWhen $A=(1,0,0)$, $|B|$ is minimized by $B=(1,0,0)$. When $A=(1,1,0)$, $|B|$ is minimized by $B=(1,0)$."},{"iden":"sample input 2","content":"8\n0 1 0 0 1 1 1 0\n3\n1\n4\n1"},{"iden":"sample output 2","content":"5\n2\n3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}