#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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 (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> tri;
typedef pair<double,double> point;
const ll MAX = 30000;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
ll string_ll(string s){
    ll l = s.length(),res = 0,now = 1;
    rep(i,l){
        res += (s[l-i-1]-'0')*now;
        now *= 10;
    }
    return res;
}

P tf(ll n){
    ll t = 0,f = 0;
    while (n%2 == 0){
        n /= 2;
        t++;
    }
    while (n%5 == 0){
        n /= 5;
        f++;
    }
    return P(t,f);
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,in = 0;
    cin >> n;
    vector<vector<ll>> dp(201,vector<ll>(201,0));
    vector<P> pa;
    rep(i,n){
        string s;
        cin >> s;
        ll l = s.length(),c = 0;
        bool p = 0;
        rep(i,l){
            if (p) c++;
            if (s[i] == '.') p = 1;
        }
        if (p){
            string t = s.substr(0,l-c-1)+s.substr(l-c);
            if (string_ll(s.substr(l-c)) == 0) in++;
            ll m = string_ll(t),k = 1;
            rep(i,c) k *= 10;
            ll d = gcd(k,m);
            k /= d;
            m /= d;
            ll t1,f1,t2,f2;
            tie(t1,f1) = tf(k);
            tie(t2,f2) = tf(m);
            dp[100-t1+t2][100-f1+f2]++;
            pa.push_back(P(t1-t2,f1-f2));
        }
        else{
            in++;
            ll m = string_ll(s),t1,f1;
            tie(t1,f1) = tf(m);
            dp[100+t1][100+f1]++;
            pa.push_back(P(-t1,-f1));
        }
    }
    for (int i = 200;i >= 1;i--){
        for (int j = 200;j >= 1;j--){
            dp[i-1][j-1] += dp[i][j-1]+dp[i-1][j]-dp[i][j];
        }
    }
    ll ans = 0;
    for (P p:pa){
        ll t,f;
        tie(t,f) = p;
        ans += dp[100+t][100+f];
    }
    PRINT((ans-in)/2);
}

Measured memory_bytes: 7724