You are given an array $$$a$$$ of length $$$n$$$. Count the number of non-empty subarrays$$$^{[1]}$$$ ($$$a[l, l + 1, \ldots, r]$$$) such that its sum is equal to its MEX$$$^{[10]}$$$.
The first line of the input contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the length of the array.
The second line of the input consists of $$$n$$$ space-separated integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 \le a_i \le 10^9$$$).
Output one line containing a single integer — the number of non-empty subarrays such that their sum is equal to their MEX.
71 0 2 0 3 4 3
2