#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod  = 1e9;
const ll N = 2e5 + 5;

int n;
double a[N],pre[N];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    map<pii,int> M;
    for(int i=0;i<n;i++){
        double x;cin>>x;
        ll y=llround(x*1e9);
        int c2=0,c5=0;
        while(y%2==0) y/=2,c2++;
        while(y%5==0) y/=5,c5++;
        M[{c2,c5}]++;
    }
    ll ans=0;
   	for(auto p1:M)
        for(auto p2:M)
            if(p1.fi.fi+p2.fi.fi>=18 && p1.fi.se+p2.fi.se>=18)
                if(p1<p2) ans+=1ll*p1.se*p2.se;
                else if(p1==p2) ans+=1ll*p1.se*(p1.se-1)/2;
    cout<<ans;
    return 0;
}