cho.sh
Notes
Loading...

File Similarity Checks

Time limit

1s

Memory limit

128 MB

Problem

In a programming contest, each of the N participants submitted exactly one file. Before announcing the results, the organizers want to check whether any two submitted files are too similar.

Comparing every pair would take too long, so pairs whose file sizes are very different are skipped. For two files, let s be the smaller size and t be the larger size. The pair is checked only when s >= 0.9 * t.

Find how many distinct pairs of submitted files must be checked.

Input

The first line contains the number of submitted files, N.

The second line contains the sizes of the files, size(F1), size(F2), ..., size(FN).

1 <= N <= 100,000, 1 <= size(Fi) <= 100,000,000, and every file size is an integer.

Output

Print the number of distinct pairs of submitted files that must be checked.