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

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef pair<ll,ll> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define EXIST(m,v) (m).find((v)) != (m).end()
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

template <typename T>
struct BIT2D {
    int H, W;
    vector<vector<T>> bit;  // データの格納先
    BIT2D(int H_, int W_) { init(H_, W_); }
    void init(int H_, int W_) {
        H = H_ + 1;
        W = W_ + 1;
        bit.assign(H, vector<T>(W, 0));
    }
 
    void add(int h, int w, T x) {
        for (int i = h; i < H; i += (i & -i)) {
            for (int j = w; j < W; j += (j & -j)) {
                bit[i][j] += x;
            }
        }
    }
    // 1≦i≦h かつ 1≦j≦w
    T sum(int h, int w) {
        T s(0);
        for (int i = h; i > 0; i -= (i & -i)) {
            for (int j = w; j > 0; j -= (j & -j)) {
                s += bit[i][j];
            }
        }
        return s;
    }
 
    // h1≦i<h2 かつ w1≦j<w2
    T query(int h1, int w1, int h2, int w2) {
        return sum(h2 - 1, w2 - 1) - sum(h2 - 1, w1 - 1) - sum(h1 - 1, w2 - 1) + sum(h1 - 1, w1 - 1);
    }
};

ll b = 60;
P trans(string A){
    int N = A.size();
    int pos = 0;
    ll p = 1;
    P ret(0,1);
    REP(i,N){
        if(A[N-1-i] == '.') pos = i;
        else{
            ll x = (ll)(A[N-1-i]-'0');
            ret.first += x*p;
            p *= 10;
        }
    }

    while(pos){
        ret.second *= 10;
        pos--;
    }
    ll g = gcd(ret.first, ret.second);
    ret.first /= g; ret.second /= g;
    ll a = 0, b = 0, c = 0, d = 0;
    while(ret.first%2 == 0){
        c++; ret.first /= 2;
    }
    while(ret.first%5 == 0){
        d++; ret.first /= 5;
    }
    while(ret.second%2 == 0){
        a++; ret.second /= 2;
    }
    while(ret.second%5 == 0){
        b++; ret.second /= 5;
    }
    ret.first = c-a; ret.second = d-b;
    return ret;
}

bool comp(P a, P b){
    ll p1=-a.first, q1=-a.second;
    ll p2=-b.first, q2=-b.second;
    if(p1 != p2) return p1<p2;
    else return q1<q2;
}

void Main(){
    int N; cin >> N;
    vector<P> v;
    REP(i,N){
        string A; cin >> A;
        auto p = trans(A);
        v.emplace_back(p);
    }
    sort(ALL(v), comp);

    BIT2D<int> bit(200, 200);
    ll ans = 0;
    REP(i,N){
        int p = v[i].first+b, q = v[i].second+b;
        ans += bit.query(0,0,p+1,q+1);
        p = -v[i].first+b; q = -v[i].second+b;
        bit.add(p, q, 1);
    }
    cout << ans << en;
    return;
}

int main(void){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t) Main();
    return 0;
}

Measured memory_bytes: 7404