Problem 1: Average, *(K Narayan Kumar, CMI)*

You are given a sequence of integers *a _{1}*,

*a*, ...,

_{2}*a*. An element

_{N}*a*is said to be an

_{k}*average element*if there are indices

*i*,

*j*(with

*i*≠

*j*) such that

*a*= (

_{k}*a*+

_{i}*a*) / 2.

_{j}In the sequence

3 7 10 22 17 15

for *i*=1, *j*=5 and *k*=3, we get
*a _{k}* = (

*a*+

_{i}*a*)/2. Thus

_{j}*a*= 10 is an average element in this sequence. You can check that

_{3}*a*is the only average element in this sequence.

_{3}Consider the sequence

3 7 10 3 18

With *i*=1, *j*=4 and *k*=1 we get
*a _{k}* = (

*a*+

_{i}*a*)/2. Thus

_{j}*a*=3 is an average element. We could also choose

_{1}*i*=1,

*j*=4 and

*k*=4 and get

*a*=(

_{k}*a*+

_{i}*a*)/2. You can check that

_{j}*a*and

_{1}*a*are the only average elements of this sequence.

_{4}On the other hand, the sequence

3 8 11 17 30

has no average elements.

Your task is to count the number of average elements in the given sequence.

Input format

The first line contains a single integer *N* indicating the
number of elements in the sequence. This is followed by *N*
lines containing one integer each (Line *i*+1 contains
*a _{i}*). (You may assume that

*a*+

_{i}*a*would not exceed MAXINT for any

_{j}*i*and

*j*).

Output format

The output must consist of a single line containing a single
integer *k* indicating the number of average elements in the
given sequence.

Test Data:

You may assume that N ≤ 10000. Further, you may assume that in
30% of the inputs *N* ≤ 200 and that in 60% of the inputs
*N* ≤ 5000.

Example:

We illustrate the input and output format using the above examples:

Sample Input 1:

6 3 7 10 17 22 15

Sample Output 1:

1

Sample Input 2:

5 3 7 10 3 18

Sample Output 2:

2

Sample Input 3;

5 3 8 11 17 30

Sample Output 3:

0

CPU Timelimit: | 3 seconds |

Memory limit: | 64M |

Grading style: | ioi |