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

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()

#define MOO(i, a, b) for(int i=a; i<b; i++)
#define M00(i, a) for(int i=0; i<a; i++)
#define MOOd(i,a,b) for(int i = (b)-1; i >= a; i--)
#define M00d(i,a) for(int i = (a)-1; i>=0; i--)

#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define finish(x) return cout << x << '\n', 0;
#define dbg(x) cerr << ">>> " << #x << " = " << x << "\n";
#define _ << " _ " <<

template<class T> bool ckmin(T& a, const T& b) {return b < a ? a = b, 1 : 0;}
template<class T> bool ckmax(T& a, const T& b) {return a < b ? a = b, 1 : 0;}

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ld,ld> pd;
typedef complex<ld> cd;

struct node {
    int val;
    int l, r;
    node* left;
    node* right;
    node(int l, int r) {
        this -> val = 0;
        this -> l = l;
        this -> r = r;
        this -> left = nullptr;
        this -> right = nullptr;
    }
};

struct st{
    node* root;
    st(int SZ) {
        int ub = 1;
        while(ub < SZ) ub *= 2;
        root = new node(0, ub-1);
    }
    void addN(node* n, int pos, int val) {
        if(pos < n->l || pos > n->r) return;
        n->val += val;
        if(n->l == n->r) {
            return;
        }

        int mid = (n->l + n->r)/2;
        if(pos > mid) {
            if(n->right == nullptr) n->right = new node(mid+1, n->r);
            addN(n->right, pos, val);
        }
        else {
            if(n->left == nullptr) n->left = new node(n->l, mid);
            addN(n->left, pos, val);
        }
    }
    void add(int pos, int val) {
        addN(root, pos, val);
    }
    int queryN(node* n, int i1, int i2) {
        if(i2 < n->l || i1 > n->r) return 0;
        if(n->l == n->r) return n->val;
        if(n->l >= i1 && n->r <= i2) return n->val;

        int ans = 0;
        if(n->left != nullptr) ans += queryN(n->left, i1, i2);
        if(n->right != nullptr) ans += queryN(n->right, i1, i2);

        return ans;
    }
    int query(int i1, int i2) {
        return queryN(root, i1, i2);
    }
};

template<int w, int l> struct segbit {
    st* b[w+1];
    segbit() {
        M00(i, w+1) b[i] = new st(l);
    }
    void add(int x, int y, int val) {
        x++;
        for(; x <= w; x+=(x&-x)) b[x]->add(y, val);
    }
    int psum(int x, int y1, int y2) {
        int ret = 0;
        x++;
        for(; x>0; x-=(x&-x)) ret+=b[x]->query(y1, y2);
        return ret;
    }
    int sum(int x1, int y1, int x2, int y2) {
        return psum(x2, y1, y2) - psum(x1-1, y1, y2);
    }
};

const ll num = 1000000000;
const int MAX_N = 200010;
int n;
ll arr[MAX_N];
pi cnts[MAX_N];
segbit<51, 51> st;

pi cnt(ll k) {
    pi res = {0,0};
    while(k%2 == 0) {
        k /= 2;
        res.f++;
    }
    while(k%5 == 0) {
        k /= 5;
        res.s++;
    }
    return res;
}

int main() { FAST
    cin >> n;
    M00(i, n) {
        string s; cin >> s;
        ll val = 0;
        int cntBef = 0;
        bool isDec = 0;
        M00(i, sz(s)) {
            if(s[i] == '.') {
                isDec = 1;
                break;
            }
            cntBef++;
        }
        if(isDec) {
            M00(i, cntBef) {
                val *= 10LL;
                val += s[i]-'0';
            }
            val *= num;
            ll fac = num/10;
            MOO(i, cntBef+1, sz(s)) {
                val += (s[i]-'0')*fac;
                fac /= 10;
            }
        } else {
            M00(i, sz(s)) {
                val *= 10LL;
                val += s[i]-'0';
            }
            val *= num;
        }
        arr[i] = val;
    }
    M00(i, n) cnts[i] = cnt(arr[i]);
    ll ans = 0;
    M00(i, n) {
        int need2 = max(0,18-cnts[i].f);
        int need5 = max(0,18-cnts[i].s);
        ans += st.sum(need2, need5, 50, 50);
        st.add(cnts[i].f, cnts[i].s, 1);
    }
    finish(ans);
}



Measured memory_bytes: 6800