A strip of n memory cells holds integer charges; a cell holding 0 is empty. A compaction pass slides every non-empty cell toward the front, preserving their left-to-right order, and pushes all empty (0) cells to the end. Report how many cell positions hold a different value after the compaction than before it.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the cell charges.
Output format
A single integer: the number of positions whose value changed.
Constraints
- 1 ≤ n ≤ 100000
- -1000000000 ≤ each charge ≤ 1000000000