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

typedef long long ll;
typedef pair<ll,ll> P;

const ll INF=1e9;
const int MOD=1e9+7;

int main(){
    ll N; cin >> N;
    map<pair<ll,ll>,ll> ma;
    ll ans=0;
 
    for(int i=0;i<N;i++){
        double a; cin >> a;
        ll res=llround(a*INF);
        ll cnt2=0; ll cnt5=0;
        while(res%2==0&&res){
            res/=2;
            cnt2++;
        }
        while(res%5==0&&res){
            res/=5;
            cnt5++;
        }
        //cout << cnt2 << " " << cnt5  << endl;
        for(auto it=ma.begin();it!=ma.end();it++){
            ll tmp2=it->first.first+cnt2;
            ll tmp5=it->first.second+cnt5;
            if(min(tmp2,tmp5)>=18) ans+=it->second;
        }
        ma[{cnt2,cnt5}]++;
        //cout << ans << endl;
    }
    cout << ans << endl;
}