You arrange white and black go stones in a single row on a table. First you place a stone at the leftmost position on the table, then a stone at the $2$nd position from the left. You repeat this $n$ times to line up $n$ stones in a horizontal row. However, when placing the new $i$-th stone, you rearrange the stones on the table according to the following rules.
For example, suppose that just after the first $7$ stones have been placed, the table looks like
○○●●○○○
(○ denotes a white stone and ● denotes a black stone.)
○○●●○○○○
○○●●●●●●
Given the order in which the stones are placed, write a program that finds the number of white stones remaining on the table after all $n$ stones have been arranged.
The first line contains a positive integer $n$ ($1 \le n \le 100000$). For each $i$ ($1 \le i \le n$), line $i+1$ contains an integer $c_i$ representing the color of the $i$-th stone placed: $c_i = 0$ means the $i$-th stone is white, and $c_i = 1$ means it is black.
Output a single line containing the number of white stones on the table after all $n$ stones have been arranged.