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

#define rep(i, n) for (int i = 0; i < (n); i++)
using i64 = int64_t;

int main() {
  int n;
  cin >> n;
  vector<i64> a(n);
  int n2 = log(1e13) / log(2) + 1;
  int n5 = log(1e13) / log(5) + 1;
  vector<i64> cnt(n2 * n5, 0);
  for (i64& x : a) {
    long double f;
    cin >> f;
    x = f * 1e9 + 0.5;
    int c2 = 0, c5 = 0;
    while (x % 2 == 0) {
      c2++;
      x /= 2;
    }
    while (x % 5 == 0) {
      c5++;
      x /= 5;
    }
    cnt[c2 * n5 + c5]++;
  }
  i64 ans = 0;
  rep(i, n2 * n5) {
    for (int j = i; j < n2 * n5; j++) {
      int i2 = i / n5, i5 = i % n5;
      int j2 = j / n5, j5 = j % n5;
      if (i2 + j2 < 18 || i5 + j5 < 18) continue;
      if (i == j) {
        ans += cnt[i] * (cnt[i] - 1) / 2;
      } else {
        ans += cnt[i] * cnt[j];
      }
    }
  }
  cout << ans << '\n';
}