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

//1点更新,区間和
class SegmentTree {
public:
    SegmentTree(int64_t n, int64_t value) {
        n_ = (int64_t)pow(2, ceil(log2(n)));
        nodes_.resize(2 * n_ - 1, value);
    }
    void update(int64_t x, int64_t v) {
        nodes_[x + n_ - 1] = v;
        for (int64_t i = (x + n_ - 2) / 2; ; i = (i - 1) / 2) {
            nodes_[i] = nodes_[2 * i + 1] + nodes_[2 * i + 2];
            if (i == 0) {
                break;
            }
        }
    }

    void addOne(int64_t x) {
        nodes_[x + n_ - 1]++;
        for (int64_t i = (x + n_ - 2) / 2; ; i = (i - 1) / 2) {
            nodes_[i] = nodes_[2 * i + 1] + nodes_[2 * i + 2];
            if (i == 0) {
                break;
            }
        }
    }

    int64_t getSum(int64_t a, int64_t b, int64_t k = 0, int64_t l = 0, int64_t r = -1) {
        if (r < 0) {
            r = n_;
        }
        if (r <= a || b <= l) {
            return 0;
        }
        if (a <= l && r <= b) {
            return nodes_[k];
        }
        int64_t lv = getSum(a, b, 2 * k + 1, l, (l + r) / 2);
        int64_t rv = getSum(a, b, 2 * k + 2, (l + r) / 2, r);
        return lv + rv;
    }

private:
    //2のべき乗
    int64_t n_;
    vector<int64_t> nodes_;
};

int main() {
    int64_t N;
    cin >> N;

    constexpr int64_t DIGIT_SIZE = 13;

    vector<string> A(N);
    for (string& a : A) {
        cin >> a;
        uint64_t period_index = a.find('.');

        //aを10^9倍する <=>
        if (period_index == string::npos) {
            //9個0を追加
            for (int64_t i = 0; i < 9; i++) {
                a.push_back('0');
            }
        } else {
            //小数点以下の数だけ0を追加
            int64_t num = 10 - (a.size() - period_index);
            a.erase(period_index, 1);
            for (int64_t i = 0; i < num; i++) {
                a.push_back('0');
            }
        }
    }

    vector<int64_t> a(N);
    for (int64_t i = 0; i < N; i++) {
        a[i] = stoll(A[i]);
    }

    struct Element {
        int64_t num_of_2, num_of_5;
        bool operator<(const Element& rhs) const {
            return num_of_2 < rhs.num_of_2;
        }
    };

    vector<Element> num_of_primes(N);
    for (int64_t i = 0; i < N; i++) {
        num_of_primes[i].num_of_2 = 0;
        while (a[i] % 2 == 0) {
            num_of_primes[i].num_of_2++;
            a[i] /= 2;
        }
        num_of_primes[i].num_of_5 = 0;
        while (a[i] % 5 == 0) {
            num_of_primes[i].num_of_5++;
            a[i] /= 5;
        }
    }

    //2の数でソート
    sort(num_of_primes.begin(), num_of_primes.end());

    int64_t ans = 0;
    int64_t ok = N;

    constexpr int64_t ST_MAX = 1e4;
    SegmentTree num_of_5s(ST_MAX, 0);
    for (int64_t i = 0; i < N; i++) {
        //2の数を考慮してiと組になれる最小のインデックスokを確定
        //okを含むインデックスが大丈夫とする
        while (ok > 0 && num_of_primes[ok - 1].num_of_2 + num_of_primes[i].num_of_2 >= 18) {
            ok--;
            num_of_5s.addOne(num_of_primes[ok].num_of_5);
        }

        //5の数を考慮してペアになれる数を列挙
        ans += num_of_5s.getSum(18 - num_of_primes[i].num_of_5, ST_MAX);

        if (num_of_primes[i].num_of_2 >= 9 && num_of_primes[i].num_of_5 >= 9) {
            ans--;
        }
    }

    cout << ans / 2 << endl;
}

Measured memory_bytes: 14352