#include <iostream>
#include <map>
#include <cmath>

using ll = long long;
using namespace std;

int main() {
    int n; cin >> n;
    map<pair<int, int>, int> cnt;
    for (int j = 0; j < n; ++j) {
        double d; cin >> d;
        ll i = llround(d*1e9);
        int two, five;
        two = five = 0;
        while (i % 2 == 0)
            i /= 2, ++two;
        while (i % 5 == 0)
            i /= 5, ++five;
        ++cnt[{two, five}];
        // cout << two << " " << five << "\n";
    }
    
    ll ans = 0;
    for (auto [p1, c1] : cnt) {
        for (auto [p2, c2] : cnt) {
            if (p1.first + p2.first >= 18 and p1.second + p2.second >= 18) {
                if (p1 < p2) {
                    ans += (ll) c1 * c2;
                } else if (p1 == p2) {
                    ans += (ll) (c1 - 1) * c1 / 2;
                }
            }
        }
    }
    cout << ans;
}