#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using P = pair<ll,ll>;
using um = unordered_map<ll,ll>;
//#define fl cout<<flush;
#define endl '\n'
template <typename T> inline void prt(T v){cout<<v<<'\n';}
template <typename T> inline bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> inline bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=(ll)1e9+7;
const ll MOD2=998244353;
const ld pi=3.14159265358979323846;
const ld eps=1e-11;

//すべて半閉区間で扱う
struct cBIT {
  vector<ll> v;
  ll n;
  cBIT(ll n) : n(n), v(n) {}
  void add(ll i, ll x) {
    i++;
    while (i <= n) {
      v[i - 1] += x;
      i += i & -i;
    }
  }
  ll sum(ll i) {
    ll r = 0;
    while (i >= 1) {
      r += v[i - 1];
      i -= i & -i;
    }
    return r;
  }
  ll sum(ll l, ll r){
    if(l>=r)return 0;
    return sum(r)-sum(l);
  }
  ll get(ll i){return sum(i+1)-sum(i);}
};
 
struct BIT {
  cBIT p, q;
  BIT(ll n) : p(n + 1), q(n + 1) {}
  void add(ll l, ll r, ll w) {
    p.add(l, -w * l);
    p.add(r, w * r);
    q.add(l, w);
    q.add(r, -w);
  }
  void add(ll i, ll w){
    add(i,i+1,w);
  }
  ll sum(ll r) {
    return p.sum(r) + q.sum(r) * r;
  }
  ll sum(ll l, ll r){
    if(l>=r)return 0;
    return sum(r)-sum(l);
  }
  ll get(ll i){return sum(i+1)-sum(i);}
};
//↑すべて半閉区間で扱う
ll Gcd(ll a,ll b) {
    while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
    }
    return a;
}
#define debug(v) cout<<#v<<": ",prt(v);
template <typename A,typename B>
inline void prt(pair<A,B> p){cout<<"("<<p.first<<", "<<p.second<<")\n";}
template <typename A,typename B,typename C>
inline void prt(tuple<A,B,C> p){cout<<"("<<get<0>(p)<<", "<<get<1>(p)<<", "<<get<2>(p)<<")\n";}
inline void prt(bool p){if(p)cout<<"True"<<'\n';else cout<<"False"<<'\n';}
template <typename T> 
inline void prt(vector<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}
template <typename T> 
inline void prt(deque<T> v){cout<<'{';for(ll i=0;i<v.size();i++){cout<<v[i];if(i<v.size()-1)cout<<", ";}cout<<'}'<<'\n';}
template <typename A,typename B>
inline void prt(map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}
template <typename A,typename B>
inline void prt(unordered_map<A,B> v){cout<<'{';ll c=0;for(auto &p: v){cout<<p.first<<":"<<p.second;c++;if(c!=v.size())cout<<", ";}cout<<'}'<<'\n';}
template <typename T> 
inline void prt(set<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}
template <typename T> 
inline void prt(multiset<T> v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';}

signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    vector<ld> A(N,0);
    for(ll i=0;i<N;++i)cin>>A[i];
    vector<ll> bunbo(N,0);
    vector<ll> bunsi(N,1000000000);
    for(ll i=0;i<N;++i){
        bunbo[i]=(ll)(A[i]*1000000000+0.9);
    }
    /*for(ll i=0;i<N;++i){
        ll k=Gcd(bunbo[i],bunsi[i]);
        bunbo[i]/=k;
        bunsi[i]/=k;
    }*/
    ll ans=0;
    vector<P> vec(0);
    vector<vector<ll>> count(70, vector<ll>(70, 0));
    for(ll i=0;i<N;++i){
        ll cou2=0;
        ll cou5=0;
        ll t=bunbo[i];
        while(t%2==0){
            t/=2;cou2++;
        }
         t=bunbo[i];
        while(t%5==0){
            t/=5;cou5++;
        }

         t=bunsi[i];
        while(t%2==0){
            t/=2;cou2--;
        }
         t=bunsi[i];
        while(t%5==0){
            t/=5;cou5--;
        }
        count[cou2+35][cou5+35]++;
    }
    for(ll i=0;i<70;++i)
        for(ll j=0;j<70;++j){
            for(ll k=0;k<70;++k){
                for(ll l=0;l<70;++l){
                    if(i==k&&j==l){continue;}
                    else {
                        if(i+k>=70&&j+l>=70)ans+=count[i][j]*count[k][l];
                    }
                }
            }
        }

        //debug(ans)
        ans/=2;
    for(ll i=35;i<70;++i){
        for(ll j=35;j<70;++j){
            ans+=count[i][j]*(count[i][j]-1)/2;
          //  debug(count[i][j]*(count[i][j]-1)/2)
        }
    }

    prt(ans);

    

    return 0;
}



Measured memory_bytes: 9560