#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int const N = 100;
int fr[N][N];
char s[N];

void ad(){
	scanf("%s", s);
	ll a = 0, b = 0;
	int i = 0;
	while (s[i] && s[i] != '.')a = 10 * a + s[i] - '0', ++i;
	int z = 100000000;
	if (s[i] == '.'){
		++i;
		while (s[i])b += z * (s[i] - '0'), ++i, z /= 10;
	}
	a = a * 1000000000 + b;
	int x = 0, y = 0;
	while (!(a & 1))++x, a >>= 1;
	while (a % 5 == 0)++y, a /= 5;
	++fr[x][y];
}

int main(){
	int n;
	scanf("%d", &n);
	f(i, 0, n)ad();
	ll an = 0;
	f(i, 0, N)f(j, 0, N)if (fr[i][j]){
		if (i << 1 >= 18 && j << 1 >= 18)an += (ll)fr[i][j] * (fr[i][j] - 1);
		f(k, 0, N)f(w, 0, N)if (!(i == k && j == w) && fr[k][w] && i + k >= 18 && j + w >= 18)an += (ll)fr[i][j] * fr[k][w];
	}
	printf("%lld\n", an >> 1);
}