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

#ifdef DEBUG
    #include "debug.h"
    #define dump(...)                                                              \
        DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
                << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
                << endl                                                            \
                << "    ",                                                         \
            dump_func(__VA_ARGS__)
#else
    #define dump(...)
#endif


// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//////////////////

#define int long long
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
#define ALL(v) (v).begin(), (v).end()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

//*
#define mod 1000000007 /*/
#define mod 998244353 //*/

typedef pair<int, int> P;
#define INF (1LL<<60)


int modpow(int a, int k, int p){
    int ans = 1;
    while (k > 0){
        if (k % 2 == 1){
            ans *= a;
            ans %= p;
        }
        a = (a*a) % p;
        k = k / 2;
    }
    return ans;
}

P factor25(int k){
    int two = 0, five = 0;
    while(k%2==0){
        k/=2;
        two++;
    }
    while(k%5==0){
        k/=5;
        five++;
    }
    return {two,five};
}

void solve(){
    int N;
    cin >> N;
    vector<int> integer;
    vector<P> frac;
    
    rep(i,N){
        string s;
        cin >> s;
        int idx = s.find(".");
        string flo,inte;
        // 小数点があれば
        if(idx!=s.npos){
            inte = s.substr(0,idx);
            flo = s.substr(idx+1,s.size()-idx);
            istringstream ss(inte+flo);
            dump(inte+flo);
            int num;
            ss >> num;
            frac.push_back(make_pair(num,flo.size()));
        }else{
            istringstream ss(s);
            int num;
            ss >> num;
            integer.push_back(num);
        }
    }
//    dump(integer);
//    for(auto i:frac) dump(i);

    vector<P> facv;
    
     for(auto p: frac){
        int bunshi = p.first;
        int bumbo = modpow(10,p.second,mod);
        P f_up = factor25(bunshi);
         P f_down = factor25(bumbo);
         
         facv.push_back({f_up.first - f_down.first, f_up.second - f_down.second});
    }
    for(auto i : integer){
        P factor = factor25(i);
        facv.push_back({factor.first,factor.second});
    }
    

    
    map<int,map<int,int>> m, s;
    for(auto p: facv){
        dump(p);
        m[p.first][p.second]++;
    }

    int limit = 30;
    /*
    for(int i=-limit; i<=limit; i++){
        for(int j=-limit; j<=limit; j++)
            cerr << m[j][i] << ",";
        cerr << endl;
    }
     */
    
    // 二次元累積和
    for (int i = -limit; i <= limit; ++i)
    for (int j = -limit; j <= limit; ++j)
        s[i+1][j+1] = s[i][j+1] + s[i+1][j] - s[i][j] + m[i][j];

    /*
    cerr << endl;
    for(int i=-limit; i<=limit+1; i++){
        for(int j=-limit; j<=limit+1; j++)
            cerr << s[j][i] << ",";
        cerr << endl;
    }*/

    int ans = 0;
    for(auto p: facv){
        int two = -p.first;
        int five = -p.second;

        ans += s[limit][limit] - s[limit][five] - s[two][limit] + s[two][five];
        
//        dump(two, five, s[10][10] - s[10][five] - s[two][10] + s[two][five]);
        
        if(p.first>=0 && p.second>=0)
            ans --;
    }
    cout << ans/2 << endl;
}


signed main(){
    cout << fixed << setprecision(18);
    cerr << fixed << setprecision(18);
    solve();
}


Measured memory_bytes: 12420