cho.sh
Notes
Loading...

Good Numbers

Time limit

2s

Memory limit

256 MB

Problem

You are given N integers. A number at one position is called a good number if it can be represented as the sum of two numbers from two other distinct positions.

Even when two values are equal, they are considered different numbers if they are at different positions. Determine how many numbers in the sequence are good.

Input

The first line contains the number of integers N (1 ≤ N ≤ 2,000).

The second line contains N integers A_i. Each integer satisfies |A_i| ≤ 1,000,000,000.

Output

Print the number of good numbers on one line.

Hint

If the sequence is 1 through 10, then 3, 4, 5, 6, 7, 8, 9, and 10 are good numbers.