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

template <typename T>
boolean vmin(T& a, T b) {
	return (a > b) ? (a = b, true) : (false);
}
template <typename T>
boolean vmax(T& a, T b) {
	return (a < b) ? (a = b, true) : (false);
}

template <typename T>
T smax(T x) {
	return x;
}
template <typename T, typename ...K>
T smax(T a, const K &...args) {
	return max(a, smax(args...));
}

template <typename T>
T smin(T x) {
	return x;
}
template <typename T, typename ...K>
T smin(T a, const K &...args) {
	return min(a, smin(args...));
}

// debugging lib

#define VN(x) #x
#define Vmsg(x) VN(x) << " = " << (x)
#define printv(x) cerr << VN(x) << " = " << (x);
#define debug(...) fprintf(stderr, __VA_ARGS__);

template <typename A, typename B>
ostream& operator << (ostream& os, const pair<A, B>& z) {
	os << "(" << z.first << ", " << z.second << ')';
	return os;
}
template <typename T>
ostream& operator << (ostream& os, const vector<T>& a) {
	boolean isfirst = true;
	os << "{";
	for (auto z : a) {
		if (!isfirst) {
			os << ", ";
		}
		os << z;
		isfirst = false;
	}
	os << '}';
	return os;
}

#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define ll long long
#define ull unsigned long long

const int inf = (signed) (~0u >> 2);
const ll llf = (signed ll) (~0ull >> 2);

#define pb push_back
#define eb emplace_back
#define fi first
#define sc second

template <typename T>
int vsize(vector<T>& x) {
	return (signed) x.size(); 
}

template <typename T>
int discrete(T* a, int* b, int n) {
    vector<T> v(a + 1, a + n + 1);
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
	for (int i = 1; i <= n; i++) b[i] = lower_bound(v.begin(), v.end(), a[i]) - v.begin() + 1;
	return v.size();
}

mt19937 rng (time(NULL));

int randint(int l, int r) {
	return rng() % (r - l + 1) + l;
}

int n;
int cnt[15][15][15][15];

void read() {
	static char s[22];
	scanf("%s", s);
	ll x = 0, y = 1e9;
	char *p = s;
	while (*p && isdigit(*p)) {
		x = x * 10 + *p - '0';
		p++;
	}
	if (*p == '.') {
		p++;
		while (*p && isdigit(*p)) {
			x = x * 10 + *p - '0';
			p++, y /= 10;
		}
	}
	x *= y;
	y = 1e9;
	ll g = __gcd(x, y);
	x /= g, y /= g;
	x = __gcd(x, (ll) 1e9);
	int c2 = 0, c5 = 0;
	while (!(x % 2))
		c2++, x >>= 1;
	while (!(x % 5))
		c5++, x /= 5;
	int d2 = 0, d5 = 0;
	x = y;
	while (!(x % 2))
		d2++, x >>= 1;
	while (!(x % 5))
		d5++, x /= 5;
	cnt[c2][c5][d2][d5]++;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	scanf("%d", &n);
	while (n--)
		read();
	long long ans = 0;
	for (int a = 0; a < 15; a++) {
		for (int b = 0; b < 15; b++) {
			for (int c = 0; c < 15; c++) {
				for (int d = 0; d < 15; d++) {
					if (cnt[a][b][c][d]) {
						int x = cnt[a][b][c][d];
						for (int e = c; e < 15; e++) {
							for (int f = d; f < 15; f++) {
								for (int h = 0; h <= a; h++) {
									for (int i = 0; i <= b; i++) {
										if (e == a && f == b && h == c && i == d) {
											ans += 1ll * x * (x - 1);
										} else {
											ans += 1ll * x * cnt[e][f][h][i];
										}
 									}
								}
							}	
						}
					}	
				}
			}
		}
	}
	ans >>= 1;
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 3748