#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>

long long mod = 1e9+7;
class Mint {
public:
  long long x;
  Mint(){}; // 引数なしでも定義できるように引数なしコンストラクタも用意しておく
  Mint(long long a){
    x = a%mod;
    while(x<0){
      x += mod;
    }
  };
  Mint& operator += (const Mint &a){
    x+=a.x;
    x%=mod;
    return *this;
  }
  Mint& operator -= (const Mint &a){
    x += (mod - a.x);
    x%=mod;
    return *this;
  }
  Mint& operator *= (const Mint &a){
    x*=a.x;
    x%=mod;
    return *this;
  }

  // a^n mod を計算する
  // Useaeg: Mint z = y.pow(y, n);
  Mint pow(Mint a, long long n) const {
    Mint y(1);
    Mint b(a);
    while (n > 0) {
      if (n & 1) y *= b;
      b *= b;
      n >>= 1;
    }
    return y;
  }

  // a^{-1} mod を計算する
  Mint modinv(const Mint &a) const {
    return pow(a, mod-2);
  }

  Mint& operator /= (const Mint &a) {
    x *= modinv(a).x;
    x %= mod;
    return *this;
  }

  Mint operator + (Mint &a) const {
    Mint y(*this);
    y += a;
    return y;
  }

  Mint operator - (Mint &a) const {
    Mint y(*this);
    y -= a;
    return y;
  }

  Mint operator * (Mint &a) const {
    Mint y(*this);
    y *= a;
    return y;
  }

  Mint operator / (Mint &a) const {
    Mint y(*this);
    y/=a;
    return y.x;
  }

  // nCk @mod を計算する
  Mint nCk(Mint &n, const long long k) const {
    Mint y = Mint(1);
    for (Mint i(0); (i.x)<k; i.x++){
      y *= (n-i);
      y /= i;
    }
    return y;
  }

  // nPk @mod を計算する
  Mint nPk(Mint &n, long long k) const {
    Mint y(1);
    for (Mint i(0); (i.x)<k; i.x++){
      y *= (n-i);
    }
    return y;
  }
};

int MAX = 69;
long long table[70][70];
long long sum[70][70];

int main() {
  int N;
  std::cin >> N;
  double a;
  std::vector<long long > A(N);
  std::vector<int > count2(N, 0), count5(N, 0), seisu(N);
  std::vector<bool> isprime(N, false);
  std::vector<bool > ng(N, false);
  for (int i=0; i<N; i++) {
    std::cin >> a;
    //A[i] = (long long)(a*1000000000.00);
    A[i] = llround(a*1000000000.00);
    if (A[i]%1000000000 == 0) isprime[i] = true;
    while(A[i]%2==0) {
      count2[i]++;
      A[i] /= 2;
    }
    while(A[i]%5==0) {
      count5[i]++;
      A[i] /= 5;
    }
  }
  for (int i=0; i<N; i++) {
    //printf("i=%d, coujt2=%d, count5=%d\n", i, count2[i], count5[i]);
    count2[i]=std::min(18, count2[i]);
    count5[i]=std::min(18, count5[i]);
    table[count2[i]][count5[i]]++;
  }
  /*sum[MAX-1][MAX-1] = table[MAX-1][MAX-1];
  for (int i=MAX-1; i>=0; i--) {
    sum[i][MAX-1] = sum[i+1][MAX-1] + table[i][MAX-1];
    sum[MAX-1][i] = sum[MAX-1][i+1] + table[MAX-1][i];
  }*/
  for (int i=MAX-1; i>=0; i--) {
    for (int j=MAX-1; j>=0; j--) {
      sum[i][j] = sum[i+1][j] + sum[i][j+1] - sum[i+1][j+1] + table[i][j];
    }
  }

  long long ans = 0;
  for (int i=0; i<N; i++) {
    /*ans += sum[std::max(0, 18-count2[i])][std::max(0, 18-count5[i])];
    //printf("+= sum[%d][%d]=%d\n", 9-count2[i], 9-count5[i], sum[9-count2[i]][9-count5[i]]);
    if (isprime[i]) {
      ans--;
    }*/
    /*if (count2[i]>=9 && count5[i]>=9) {
      ans += sum[std::max(0, 18-count2[i])][std::max(0, 18-count5[i])] -1;
    } else {
      ans += sum[std::max(0, 18-count2[i])][std::max(0, 18-count5[i])];
    }*/
    int need2 = 18-count2[i];
    int need5 = 18-count5[i];
    ans += sum[need2][need5];
    if (need2<=9 && need5<=9) ans--;
  }
  ans /= 2;
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 6692