#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<vector<int>> ten(20, vector<int>(20, 0));
  int64_t res = 0;
  for (int i = 0; i < N; i++) {
    double x;
    cin >> x;
    int64_t y = x * 1000000000 + 0.1;
    int two = 0, five = 0;
    while (y % 2 == 0) {
      y /= 2;
      two++;
    }
    while (y % 5 == 0) {
      y /= 5;
      five++;
    }
    two = min(two, 18);
    five = min(five, 18);
    for (int j = 18 - two; j <= 18; j++) {
      for (int k = 18 - five; k <= 18; k++) {
        res += ten[j][k];
      }
    }
    ten[two][five]++;
  }
  cout << res << '\n';
  return 0;
}
