A ship's hull has n ballast tanks in a row, each holding an integer load (which may be negative to model a buoyancy correction). An index i (0-indexed) is called a balance point if the total load of all tanks strictly to the left of i equals the total load of all tanks strictly to the right of i. The tank at i itself is not counted on either side. For the first index the left side is empty (sum 0); for the last index the right side is empty (sum 0).
Count how many balance points the row has.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the tank loads from left to right.
Output format
A single integer: the number of balance points.
Constraints
- 1 <= n <= 100000
- -1000000 <= each load <= 1000000