#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include<algorithm>
using namespace std;
bool good(int a, int b) {
int max = a >= b ? a : b;
int min = a < b ? a : b;
return min >= (0.9 * max);
}
int main() {
int n;
long temp[10005];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> temp[i];
}
if (n == 2)
{
if (good(temp[0], temp[1])) {
cout << 1 << endl;
}
else {
cout << 0 << endl;
}
}
int sum = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (good(temp[i], temp[j])) {
sum++;
}
}
}
cout << sum;
return 0;
}