#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    double a[n];
    pair<int,int>p[n];
    int fac[20][20]={};
    for(int i=0;i<n;i++){
        cin>>a[i];
        long long x=(a[i]+0.0000000001)*1000000000;
        int two=0,five=0;
        while(x%2==0)two++,x/=2;
        while(x%5==0)five++,x/=5;
        two=min(18,two),five=min(18,five);
        fac[two+1][five+1]++;
        p[i]={18-two,18-five};
    }
    for(int i=0;i<20;i++)for(int j=0;j<19;j++)fac[i][j+1]+=fac[i][j];
    for(int i=0;i<20;i++)for(int j=0;j<19;j++)fac[j+1][i]+=fac[j][i];
    long long ans=0;
    for(int i=0;i<n;i++){
        int x=fac[19][19]-fac[p[i].first][19]-fac[19][p[i].second]+fac[p[i].first][p[i].second];
        if(p[i].first<10 && p[i].second<10)x--;
        ans+=x;
}
    cout<<ans/2<<endl;
    return 0;
}
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>

using ll = long long ;
#define MAXN 200009
#define MAXL 29 
std::map<std::pair<int,int>, int> bucket;

class Rat
{
    private:
        int cofp2,cofp5;
    public:
        Rat(){}
        Rat(ll nn,ll dd)
        {
           ll tn = nn;
           ll td = dd;
           cofp2 = 0;
           while( tn%2==0){
               cofp2++;
               tn/=2;
           } 
           while(td%2==0){
               cofp2--;
               td/=2;
           }
           cofp5=0;
           while(tn%5==0){
               cofp5++;
               tn/=5;
           }
           while(td%5==0){
               cofp5--;
               td/=5;
           }
        }
        void output() 
        { 
            printf("2^{%d}*5^{%d}\n",cofp2,cofp5); 
        } 
        int getcofp2()
        {
            return cofp2;
        }
        int getcofp5()
        {
            return cofp5;
        }
}; 
        

int main(void) 
{ 
    char theNumber[MAXL]; 
    int N,i,j;
    scanf("%d",&N);
    Rat *a ;

    for (i=0;i<N;i++){
        scanf("%s",theNumber);
        char* ret = strchr(theNumber,'.');
        if (ret==NULL){
            a = new Rat(atoi(theNumber),1); 
        } else {
            int lenOfDen = strlen(&theNumber[ret-&theNumber[0]+1]);
            ll den = pow(10,lenOfDen); 
            ll num = atoi(theNumber)*den
            +atoi(&theNumber[ret-&theNumber[0]+1]);
            a = new Rat(num,den);
        }
        bucket[std::make_pair(a->getcofp2(),a->getcofp5())] ++;
    }

    ll s=0;
    for (auto it:bucket) {
        int x1 = it.first.first;
        int y1 = it.first.second;
        int r1 = it.second;
        for (auto it2:bucket) {
            int x2 = it2.first.first;
            int y2 = it2.first.second;
            int r2 = it2.second;

            if(x1+x2>=0 && y1+y2>=0)
            {
                if(it<it2){
                    s+=((ll)r1)*r2;
                } else if (it==it2) {
                    s+=((ll)r1*(r1-1))/2;
                }
            }
        }
    }

    printf("%lld\n",s);

    return 0;
}
