//#include<cstdio>
//#include<cassert>
//#include<iostream>
//#include<cstring>
//#include<algorithm>
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)1e6 + 5)
#define MAXL ((ll)1e18 + 5)
#define MAX_X ((ll)1e5 + 2)
#define pi (2.0*acos(0))
#define M ((int)1e6 + 7)
#define MOD ((int)1e9 + 7)
#define NN ((int)62500 + 7)
#define N ((int)2e5 + 5)
#define eps (0)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define logn 29
#define endl "\n"
#define mp make_pair
#define BUCK 105
#define LEF (idx<<1)
#define RIG ((idx<<1)|1)
//#define int ll


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/




typedef tree < int,  null_type,  less < int >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
//typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

int fun(ll n , ll div)
{
    int cnt = 0;
    while(n % div == 0){
        cnt++;
        n /= div;
    }
    return cnt;
}

int cnt[72][72] , up[N] , acnt[72][72];

pair < int , int > arr[N];

int main()
{
//    double a = 1e4;
//    ll b = a*(1e9);
//    //cout<<b<<endl;
    //fastio;
    int n;
    cin>>n;
    for(int i = 1 ; i<=n ; i++){
        string a;
        cin>>a;
        ll upp = 0;
        ll down = 1000000000;
        int tot = 0;
        bool flag = 0;
        for(int ite = 0 ; ite<a.length(); ite++){
            if(a[ite] == '.'){
                flag = 1;
                continue;
            }
            upp = upp*10 + (a[ite] - '0');
            tot += flag;
        }
        while(tot<9){
            upp *= 10;
            tot++;
        }
        //cout<<upp<<" "<<down<<endl;
        ll g = __gcd(upp,down);
        upp /= g;
        down /= g;
        //cout<<upp<<" "<<down<<" "<<g<<endl;
        arr[i] = {fun(down,2),fun(down,5)};
        //cout<<arr[i].first<<" "<<arr[i].second<<endl;
        if(arr[i] == make_pair(0,0)) cnt[fun(upp,2)][fun(upp,5)]++;
        else if(arr[i].first == 0) up[i] = fun(upp,2);
        else if(arr[i].second == 0) acnt[fun(down,2)][fun(upp,5)]++;
    }
    for(int i = 70 ; i>=0 ; i--){
        for(int j = 70 ; j>=0; j--){
            cnt[i][j] += cnt[i][j+1];
            acnt[i][j] += acnt[i][j+1];
        }
    }


    ll ans = 0 , intc = 0;
    for(int i = 1 ; i<=n ; i++){
//        if(arr[i].first > 0 && arr[i].second > 0) ans += cnt[arr[i].first][arr[i].second];
        ll sum = 0;
        for(int j = arr[i].first ; j<=70 ; j++) sum += cnt[j][arr[i].second];
        if(arr[i] == make_pair(0,0)){
            intc += sum-1;
        }
        else{
            ans += sum;
            if(arr[i].first == 0){
                for(int j = up[i]; j>=0; j--){
                    ans += acnt[j][arr[i].second];
                }
            }
        }
    }
    cout<<ans + intc/2<<endl;
    return 0;
}


Measured memory_bytes: 5956