You are given a sequence A consisting of N integers. We will call the i-th element *good* if it equals the sum of some three elements in positions strictly smaller than i (an element can be used more than once in the sum).
How many good elements does the sequence contain?
The first line of input contains the positive integer N (1 ≤ N ≤ 5000), the length of the sequence A.
The second line of input contains N space-separated integers representing the sequence A ( - 105 ≤ Ai ≤ 105).
The first and only line of output must contain the number of good elements in the sequence.
## Input
The first line of input contains the positive integer N (1 ≤ N ≤ 5000), the length of the sequence A.The second line of input contains N space-separated integers representing the sequence A ( - 105 ≤ Ai ≤ 105).
## Output
The first and only line of output must contain the number of good elements in the sequence.
[samples]
**Definitions**
Let $ N \in \mathbb{Z}^+ $ be the length of the sequence.
Let $ A = (a_1, a_2, \dots, a_N) $ be a sequence of integers, where $ a_i \in \mathbb{Z} $ for all $ i \in \{1, \dots, N\} $.
**Constraints**
1. $ 1 \leq N \leq 5000 $
2. $ -10^5 \leq a_i \leq 10^5 $ for all $ i \in \{1, \dots, N\} $
**Objective**
Define an element $ a_i $ (for $ i \geq 4 $) as *good* if there exist indices $ j, k, \ell \in \{1, \dots, i-1\} $ (not necessarily distinct) such that:
$$ a_i = a_j + a_k + a_\ell $$
Compute the number of good elements in $ A $, i.e.,
$$ \left| \left\{ i \in \{4, \dots, N\} \mid \exists\, j,k,\ell \in \{1, \dots, i-1\} \text{ such that } a_i = a_j + a_k + a_\ell \right\} \right| $$