#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

const int M = 64;

int main() {
    int N; cin >> N;
    auto f = [&](int64_t n) -> pair<int, int> {
        int two = 0, five = 0;
        while(n % 2 == 0) n /= 2, two++;
        while(n % 5 == 0) n /= 5, five++;
        return make_pair(two, five);
    };

    vector<vector<int64_t>> A(M, vector<int64_t>(M));
    rep(i, N) {
        long double a; cin >> a;
        int64_t l = (int64_t)(a * 1e9 + 0.5);
        auto[two, five] = f(l);
        A[two][five]++;
    }

    int64_t ans = 0;
    rep(t, M) rep(f, M) rep(_t, M) rep(_f, M) {
        if(make_pair(t, f) <= make_pair(_t, _f)) {
            if(t + _t < 18 || f + _f < 18) continue;
            if(t == _t && f == _f) ans += A[t][f] * (A[t][f] - 1) / 2;
            else ans += A[t][f] * A[_t][_f];
        }
    }
    cout << ans << '\n';
    return 0;
}
