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

#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)

int N;
int A[200010];
int mem[30][50];

signed main()
{
    cin >> N;
    rep(i, N)
    {
        double d;
        cin >> d;
        A[i] = llround(d * 1e9);
    }

    int ans = 0;
    rep(i, N)
    {
        int cnt2 = 0, cnt5 = 0;
        int a = A[i];
        while(a % 2 == 0)
        {
            a /= 2;
            cnt2++;
        }
        while(a % 5 == 0)
        {
            a /= 5;
            cnt5++;
        }

        for(int j = 18 - cnt5; j < 30; j++)for(int k = 18 - cnt2; k < 50; k++)ans += mem[j][k];
        mem[cnt5][cnt2]++;
    }

    cout << ans <<endl;

    return 0;
}
