#include <bits/stdc++.h>
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define pii pair<int, int>

using namespace std;

int main() {
    //freopen("output.txt", "w", stdout);
    int n; cin >> n;
    vector<ll> arr;
    for (int i=0; i<n; i++) {
        double a; cin >> a;
        ll b = llround(a * 1e9);
        arr.push_back(b);
    }
    
    map<pii,int> mp;

    ll cnt = 0;
    for (int i=0; i<n; i++) {
        int t = -9, f = -9;
        while(arr[i] % 2 == 0) arr[i]/=2, t++;
        while(arr[i] % 5 == 0) arr[i]/=5, f++;
        
        for (auto i: mp) {
            pii tf = i.first;
            int v = i.second;

            if (tf.first + t >= 0 and tf.second + f >= 0) cnt += v;
        }

        mp[{t,f}]++;
    }
    cout << cnt << endl;
}