#include<bits/stdc++.h>
using namespace std;
using LL = long long;
int cnt[19][19];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int N;
    LL ans = 0;
    for(cin >> N; N; N -= 1){
        long double A;
        cin >> A;
        LL X = A * 1000000000 + .5;
        int u = 0, v = 0;
        for(; X % 2 == 0 and u < 18; X /= 2) u += 1;
        for(; X % 5 == 0 and v < 18; X /= 5) v += 1;
        for(int i = 18 - u; i <= 18; i += 1)
            for(int j = 18 - v; j <= 18; j += 1)
                ans += cnt[i][j];
        cnt[u][v] += 1;
    }
    cout << ans;
    return 0;
}