Pavel is sending his friend Egor an array of non-negative integers. He wants to be sure that nobody changes the array before Egor receives it, so he computes a checksum, a digest, of the array.
Pavel invented his own digest. For every subarray, compute the bitwise XOR of its elements and the bitwise AND of the same elements, then count the subarrays where the two values are equal. A subarray is one or more consecutive elements of the array.
For example, take the array of four numbers written in binary as 01, 10, 11, 11, which is 1, 2, 3, 3 in decimal. Six of its subarrays have equal XOR and AND. Each of the four single-element subarrays qualifies, because for one number the XOR and the AND are both that number. The first through third elements give XOR 0 and AND 0. The second through fourth elements give XOR 10 and AND 10 in binary, which is 2 in decimal.
Compute this digest of the given array.
The first line contains one integer n (1≤n≤100000).
The second line contains n non-negative integers ai (0≤ai≤231−1) written in decimal notation and separated by spaces.
On the first line print Pavel's digest of the given array, that is, the number of subarrays whose bitwise XOR equals their bitwise AND.
The sample input is the array described in the statement.