#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
#define reps(i, a, n) for (int i = (a); i < (n); ++i)
#define rep(i, n) reps(i, 0, n)
#define deps(i, a, n) for (int i = (a); i >= (n); --i)
#define dep(i, n) deps(i, n, 0)
#define inf 2147483647
#define int long long

signed main(void)
{
	int n, ans = 0, num[50][50] = {0};
	cin >> n;
	while (n--)
	{
		double x; cin >> x;
		int tmp = x * 1e9 + 0.5;
		int n2 = 0, n5 = 0;
		while (tmp % 2 == 0) {n2++; tmp /= 2;}
		while (tmp % 5 == 0) {n5++; tmp /= 5;}
		reps (i, n2 <= 18 ? 18 - n2 : 0, 50)
		{
			reps (j, n5 <= 18 ? 18 - n5 : 0, 50)
			{
				ans += num[i][j];
			}
		}
		num[n2][n5]++;
	}
	cout << ans << endl;
	return 0;
}
