#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	map<pair<int,int>, int> f;
	for (int i = 1; i <= n; i++) {
		double x;
		scanf("%lf", &x);
		long long y = llround(x * 1e9);
		int cnt1, cnt2;
		cnt1 = cnt2 = 0;
		while (y % 2 == 0) {
			y /= 2;
			cnt1++;
		}
		while (y % 5 == 0) {
			y /= 5;
			cnt2++;
		}
		f[make_pair(cnt1, cnt2)]++;
	}
	long long ans = 0;
	for (auto p1 : f)
		for (auto p2 : f) {
			if (p1.first.first + p2.first.first >= 18 && p1.first.second + p2.first.second >= 18) {
				if (p2 < p1) ans += (long long) p1.second * p2.second;
				if (p1 == p2) ans += ((long long) p1.second * p2.second - p1.second) / 2;
			}
		}
	cout << ans << endl;
}