#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <vector>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <string.h>
 
#define rep(i,n)    for(ll i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(ll i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define INF (ll)ll_MAX
 
typedef long long ll;
typedef long double ld;
typedef std::pair<ll, ll> pii;
typedef std::vector< ll > vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, ll > > vpp;
 
const ll N = 3*1e5 +5 ;
const long long MOD = 1000000007;
const long long MOD2 = 998244353;
const long long inf = 1e18;
 
using namespace std;

bool sortby(const pair<ll,ll> a, const pair<ll,ll> b){
    return a.fi<b.fi;
}


void solve()
{
    ll n;
    cin>>n;
    // double a[n];

    // for(ll i=0;i<n;i++){
    //     cin>>a[i];
    // cout<<a[i]<<endl;
    // }

    ll dp[200][200];
    memset(dp,0,sizeof(dp));
    long long ans = 0;

    for(ll i=0;i<n;i++){
        string a;
        cin>>a;

        bool ok = false;
        int ind = -1;

        for(int j=0;j<a.length();j++){
            if(a[j]=='.'){
                ok = true;
                ind = j;
                break;
            }
        }

        int n2,n5;
        n2 = 0;
        n5 = 0;
        ll tempi;


        int temp;
        if(!ok){
            tempi = stoi(a);

        }
        
        else{
            string s1,s2;
            s1 = a.substr(0,ind);
            ll t1 = stoi(s1);
            // s2 = a.substr(ind+1,a.length()-ind-1);
            ll t2;
            if(ind == a.length()-1) t2=0;
            else t2 = stoi(a.substr(ind+1,a.length()-ind-1));

            // if(s2.length()==0) t2=0;
            // else t2 = stoi(s2);

            int k = a.length()-ind-1;
            n2 = k;
            n5 = k;
            while(k--){
                t1*= 10;
            }
            t1+=t2;
            tempi = t1;


        }




        // double temp = a[i];
        // while(temp!=roundf(temp)){
        //     temp*=10;
        //     n2++;
        //     n5++;
        //     if(n2==9) break;
        // }
        // cout<<n2<<' '<<n5<<endl;



        while(tempi%5==0){
            tempi/=5;
            n5--;
        }
        while(tempi%2==0){
            tempi/=2;
            n2--;
        }
        // cout<<n2<<' '<<n5<<endl;
        

        for(int i=0;i<=100-n2;i++){
            for(int j=0;j<=100-n5;j++){
                ans+= dp[i][j];
            }
        }
        dp[100+n2][100+n5]++;
        // cout<<ans<<endl;

    

    }

    // int x = stoi("");
    // cout<<x;

    cout<<ans;

}








int main() {



    // #ifndef ONLINE_JUDGE
    //     // for getting input from input.txt
    //     freopen("input.txt", "r", stdin);
    //     // for writing output to output.txt
    //     freopen("output.txt", "w", stdout);
    // #endif


    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    ll t = 1;
    // cin>>t;
    ll ctr=0;
    while(t--)
    {   
        ctr++;
        // cout<<"Case #"<<ctr<<": ";
        solve();    
    } 
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
}


Measured memory_bytes: 4088