/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int gcd(int a, int b) {
    if(b == 0) return a;
    return gcd(b, a % b);
}

void solve() {
	int n; cin >> n;
    static int co[200][200];
    rep(i, 200) {
        rep(j, 200) {
            co[i][j] = 0;
        }
    }
    vector<int> t(n), f(n);
    rep(i, n) {
        string s; cin >> s;
        int m = (int)s.size();
        int cnt = 0;
        bool check = 0;
        int pw = 1LL;
        int res = 0;
        per(j, m) {
            if(s[j] == '.') {
                check = 1;
                continue;
            } else {
                res += (s[j] - '0') * pw;
                pw *= 10LL;
                if(!check) ++ cnt;
            }
        }
        //cerr << res << " " << cnt << endl;
        int mom = 1LL;
        if(check) rep(j, cnt) mom *= 10LL;
        int d = gcd(mom, res);
        mom /= d, res /= d;
        int two = 100, five = 100;
        while(res % 2 == 0) {
            ++ two;
            res /= 2;
        }
        while(res % 5 == 0) {
            ++ five;
            res /= 5;
        }
        while(mom % 2 == 0) {
            -- two;
            mom /= 2;
        }
        while(mom % 5 == 0) {
            -- five;
            mom /= 5;
        }
        t[i] = two, f[i] = five;
        co[two][five] ++;
    }
    static int scnt[201][201];
    rep(i, 201) {
        rep(j, 201) {
            scnt[i][j] = 0;
        }
    }
    rep(i, 200) {
        rep(j, 200) {
            scnt[i + 1][j + 1] = scnt[i + 1][j] + scnt[i][j + 1] - scnt[i][j] + co[i][j];
        }
    }
    int ans = 0;
    rep(i, n) {
        int a = 200 - t[i], b = 200 - f[i];
        ans += n - (scnt[a][200] + scnt[200][b] - scnt[a][b]);
        if(t[i] >= 100 and f[i] >= 100) -- ans;
    }
    cout << ans / 2 << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 6772