Color Sequence
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 64 M,其他语言128 M
64bit IO Format: %lld

题目描述

You are given a integer sequence of length n, ci denotes the ith color in the sequence c.

We define a color sequence is legal only if it merely contains colors that appear even number of times.

For example, sequence {0,1,0,1} is legal because both color 1 and 0 appear 2 times, and 2 is an even number. And sequence {0,1,0} is illegal because color 1 only appear 1 time, and 1 is not an even number.

Now, you need to figure out how many consecutive subsequence of c that is a legal color sequence.

输入描述:

The first line contains one integern(1≤n≤106), the length of the sequence c.

The second line contains n integer, the ith integer denotes the ith color, ci(0≤ci≤20).

输出描述:

Print one integer as the answer.

示例1

输入

复制
3
1 1 1

输出

复制
2