#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

ll f[100][100];

int main(){
	int n=read();
	For(i,1,n){
		double x;
		scanf("%lf",&x);
		ll y=(ll)(x*1e9+0.5);
		int a=0,b=0;
		while (y%2==0) y/=2,a++;
		while (y%5==0) y/=5,b++;
		f[a][b]++;
	}
	ll ans=0,ans2=0;
	For(i,0,60) For(j,0,60) if (f[i][j]){
		For(_i,0,60) For(_j,0,60) if (f[_i][_j]&&min(i+_i,j+_j)>=18){
			if (i!=_i||j!=_j) ans+=f[i][j]*f[_i][_j];
				else ans2+=f[i][j]*(f[i][j]-1)/2;
		}
	}
	printf("%lld\n",ans/2+ans2);
}
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);


    ll n;
    cin >> n;

    vpl r(n);
    map<pll, ll> m;
    vpl f;
    REP(i, n) {
        string s;
        cin >> s;

        ll k = s.size();
        ll p = k - 1;
        REP(i, k) {
            if (s[i] == '.')
                p = i;
        }

        ll num = 0;
        REP(i, k) {
            if (s[i] == '.')
                continue;
            num *= 10;
            num += s[i] - '0';
        }
        ll r2 = 0, r5 = 0;
        REP(i, k - p - 1) {
            if (num % 2 == 0)num /= 2;
            else r2 -= 1;

            if (num % 5 == 0)num /= 5;
            else r5 -= 1;
        }

        while (num % 2 == 0) {
            num /= 2;
            r2++;
        }
        while (num % 5 == 0) {
            num /= 5;
            r5++;
        }

        r[i].first = r2;
        r[i].second = r5;

        m[r[i]] += 1;
    }


    ll ans = 0;
    //  for(ll i=-10; i<=14; i++){
    //      for (ll j = -10; j <= 14; j++) {
    //          ll t = m[pll(i, j)];
    //          if (t == 0)
    //              continue;
    //
    //		  ll res = 0;
    //		  for (ll k = i; k <= 14; k++) {
    //              for (ll q = -10; q <= 14; q++) {
    //				  if (k + i < 0 || q + j < 0)
    //					  continue;
    //
    //
    //                  if (k == i && q < j)
    //                      continue;
    //				  if (k == i && q == j)
    //					  res += t * (t - 1) / 2;
    //				  else
    //					  res += t * m[pll(k, q)];
    //
    //
    //              }
    //          }
    //
    //		  ans += res;
    //
    //	  }
    //  }

    for (auto p1 : m) {
        ll res = 0;
        for (auto p2 : m) {
            if (p1.FI.FI + p2.FI.FI < 0 || p1.FI.SE + p2.FI.SE < 0)
                continue;
            if (p1.FI > p2.FI)
                continue;

			if (p1 == p2)
				res += p1.SE * (p1.SE - 1) / 2;
			else
				res += p1.SE * p2.SE;
        }

        ans += res;
    }

	cout << ans << endl;

}


