#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007

int bs(ll k,vector<ll> & v){
  int l = -1,r = v.size();
  while(r-l > 1){
    int mid = (l+r)/2;
    if(v[mid] < k)l = mid;
    else r = mid;
  }
  return r;
}

int main(){
  
  ll n;
  cin >> n;
  vector<vector<ll>> v(30);
  vector<P> w(n);
  rep(i,n){
    string s;cin >> s;
    ll a = 0,b = 0,digit = 0;
    rep(k,s.size()){
      if(s[k] == '.'){
        for(ll j = k+1;j < s.size();j++)b = b*10+s[j]-'0',digit++;
        break;
      }
      a = a*10+s[k]-'0';
    }
    a *= 1000000000ll;
    rep(g,9-digit)b *= 10ll;
    a += b;
    ll two = 0,five = 0;
    while(!(a & 1))two++,a >>= 1;
    while(!(a % 5))five++,a /= 5;
    w[i] = make_pair(five,two);
    v[five].push_back(two);
  }
  rep(i,30)sort(ALL(v[i]));
  ll res = 0;
  rep(i,n){
    ll k = max(0,18-w[i].first);
    for(ll j = k;j < 30;j++){
      ll pos = max(0,bs(18-w[i].second,v[j]));
      ll l = v[j].size();
      res += l - pos;
    }
    if(w[i].first >= 9 && w[i].second >= 9)res--;
  }
  res >>= 1;
  cout << res << "\n";
  

  return 0;
}
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n; cin >> n;

	vector<vector<int> > ten(20, vector<int>(20, 0));
	ll cnt = 0;
	REP(i, n) {
		double x; cin >> x;
		ll tmp = x * 1e9 + 0.1;
		int two = 0;
		int five = 0;
		while (!(tmp % 2)) {
			tmp /= 2;
			two++;
		}
		while (!(tmp % 5)) {
			tmp /= 5;
			five++;
		}
		if (two > 18) two = 18;
		if (five > 18) five = 18;
		for (int j = 18 - two; j <= 18; j++)
			for (int k = 18 - five; k <= 18; k++)
				cnt += ten[j][k];
		ten[two][five]++;
	}

	cout << cnt << '\n';
    return 0;
}
