A plant#12196

A plant

1 second
256 megabytes
Easy

In CS2 there's a warmup, so why not make one here too?

Given an array of size . Find the number of pairs i,j(1 \le i < j \le n) such that (a_i+a_j)^2 = a_i + a_j.

Input

The first line contains one integer (1 \leq n \leq 2 \cdot 10^5) — the size of array .

The second line contains integers a_i (-n \leq a_i \leq n) representing the elements of the array .

Output

Output the number of pairs i,j(1 \le i < j \le n) such that (a_i+a_j)^2 = a_i + a_j.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Scoring

  1. ( points): a_i = 0

  2. ( points): 0 \le a_i \le 1;

  3. ( points): -1 \le a_i \le 1;

  4. ( points): n \le 100;

  5. ( points): no additional constraints