SOLVE
LATER
There are a lot of Poke'mons who are jealous of the fact that they do NOT have any specialty, they're the... normal type of Poke'mon. But, what they fail to realize is that their power is their normalcy, the ability to think, rationalize and then act.
But, they do have an additional power... Poke'mons like Jigglypuff - which are normal, can figure out if a trainer is real or is a part of Team Rocket. And they need to use their power to a great extent.
In an array, which consists of $$N$$ elements, A_{1}, A_{2, }..., A_{N}, if a subarray has the total number of distinct elements as that of the original array, that determines the presence of Team Rocket.
You've to help the normal type Poke'mons in figuring out the total number of subarrays having total number of distinct elements same as that of the original array.
Input format:
The first line of the input will consist of a single integer $$N$$. The next line will consist of $$N$$ integers A_{1}, A_{2, }... , A_{N}.
Output format: Output the answer to the problem.
Constraints:
1 ≤ $$N$$ ≤ 2 * 10^{5}
1 ≤ $$A$$_{i} ≤ 10^{9}
Reference:
All the possible subarrays are [1,2] , [1,3] , [1,4] , [1,5] , [2,4] , [2,5] , [3,4] , [3,5]