#include <bits/stdc++.h>
#ifdef LOCAL
#include "debuger.hpp"
#else
#define DUMP(...) 1145141919810
#define CHECK(...) (__VA_ARGS__)
#endif

int main() {
  int n;
  scanf("%d", &n);
  std::map<std::pair<int, int>, int> map;
  for (int i = 0; i < n; ++i) {
    double x;
    scanf("%lf", &x);
    long long w = llround(x * 1e9);
    int two = 0, five = 0;
    while (w % 2 == 0) w /= 2, ++two;
    while (w % 5 == 0) w /=5, ++five;
    map[{two, five}]++;
  }
  long long result = 0;
  for (const auto& a : map) {
    for (const auto& b : map) {
      if (a.first.first + b.first.first >= 18 &&
          a.first.second + b.first.second >= 18) {
        if (a < b)
          result += a.second * 1LL * b.second;
        else if (a == b)
          result += a.second * 1LL * (a.second - 1) / 2;
      }
    }
  }
  printf("%lld\n", result);
}
