Loading [MathJax]/jax/output/CommonHTML/jax.js
Odd - MarisaOJ: Marisa Online Judge

Odd

Time limit: 2000 ms
Memory limit: 256 MB

Given an array A of n integers. Count the number of contiguous subsequences such that all values in the subsequence appear an odd number of times.

Input

  • The first line contains two integers n.
  • The second line contains n integers Ai.

Output

  • Print an integer, the number of subsequences that satisfy the condition.

Constraints

  • 1≤n,Ai≤105.

Example

Input:

3
1 2 2

Output:

4