//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
// 293206GT
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#include <stack>
#include <string>
#include<algorithm>
#include <random>
#include <bitset>
#include <chrono>

typedef long long ll;
#define int ll
using namespace std;
#define put(a) cout << (a) << '\n'
#define sqr(x) (x) * (x)
typedef pair<int, int> pii;
typedef long double ld;
typedef pair<ld, ld> pld;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<pii> vpii;
#define rep(x, y, a) for (int x = (y); x < (int)(a); ++x)
#define all(a) a.begin(), a.end()
#define chkmax(a, b) a = max(a, (b))
#define chkmin(a, b) a = min(a, (b))
#define prev asasdasd
#define next aasdasda
#define left asdasdasdasd
#define right asnabsdkasdl
#define rank asdasdknlasd
#define move asdasdas

namespace IO {

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a);

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a);

    template<class A, class B>
    ostream &operator<<(ostream &out, pair<A, B> a) {
        out << a.first << " " << a.second;
        return out;
    }

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> a) {
        for (pair<A, B> x: a)
            out << x.first << " " << x.second << '\n';
        return out;
    }

    template<class A>
    ostream &operator<<(ostream &out, vector<A> a) {
        for (A x: a) out << x << ' ';
        return out;
    }

    template<class A, class B>
    istream &operator>>(istream &in, pair<A, B> &a) {
        in >> a.first >> a.second;
        return in;
    }

    template<class A>
    istream &operator>>(istream &in, vector<A> &a) {
        for (A &x: a) in >> x;
        return in;
    }
}
using namespace IO;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int K = 1000000000;
void solve() {
    int n;
    cin >> n;
    vi a(n);
    vi add_2(n), add_5(n);
    rep(i, 0, n) {
        string s;
        cin >> s;
        int wh = 0;
        rep(j, 0, s.size()) {
            if (s[j] == '.') break;
            wh *= 10;
            wh += s[j] - '0';
        }
        int cur = wh * K;
        if (count(all(s), '.')) {
            int cur2 = 0;
            int r = 0;
            rep(j, find(all(s), '.') - s.begin() + 1, s.size()) {
                cur2 *= 10;
                cur2 += s[j] - '0';
                ++r;
            }
            rep(j, 0, 9 - r)cur2 *= 10;
            cur += cur2;
        }
        a[i] = cur;
    }
    int ans = 0;
    vector<vi> cnt(60, vi(30));
    rep(i, 0, n) {
        int cnt2 = 0;
        while (a[i] % 2 == 0) {
            ++cnt2;
            a[i] /= 2;
        }
        cnt2 += add_2[i];
        int cnt5 = 0;
        while (a[i] % 5 == 0) {
            ++cnt5;
            a[i] /= 5;
        }
        cnt5 += add_5[i];
        rep(i, max(0ll, 18 - cnt2), 60) {
            rep(j, max(0ll, 18 - cnt5), 30) {
                ans += cnt[i][j];
            }
        }
        ++cnt[cnt2][cnt5];
    }
    put(ans);
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(30);
//    freopen("input.txt", "r", stdin);
    int q = 1;
//    cin >> q;

    while (q--) solve();
}


Measured memory_bytes: 7524