Gromah and LZR have entered the second level. There is a sequence
on the wall.
There is also a note board saying "the beauty value of a sequence is the number of different elements in the sequence".
LZR soon comes up with the password of this level, which is the sum of the beauty values of all successive subintervals of the sequence on the wall.
Please help them determine the password!
输入描述:
The first line contains one positive integer

, denoting the length of the sequence.
The second line contains

positive integers

, denoting the sequence.

输出描述:
Print a non-negative integer in a single line, denoting the answer.