#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline int my_getchar_unlocked(){
  static char buf[1048576];
  static int s = 1048576;
  static int e = 1048576;
  if(s == e && e == 1048576){
    e = fread_unlocked(buf, 1, 1048576, stdin);
    s = 0;
  }
  if(s == e){
    return EOF;
  }
  return buf[s++];
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void rd(char &c){
  int i;
  for(;;){
    i = my_getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c = i;
}
inline int rd(char c[]){
  int i;
  int sz = 0;
  for(;;){
    i = my_getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = my_getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
struct MY_WRITER{
  char buf[1048576];
  int s;
  int e;
  MY_WRITER(){
    s = 0;
    e = 1048576;
  }
  ~MY_WRITER(){
    if(s){
      fwrite_unlocked(buf, 1, s, stdout);
    }
  }
}
;
MY_WRITER MY_WRITER_VAR;
void my_putchar_unlocked(int a){
  if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
    fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
    MY_WRITER_VAR.s = 0;
  }
  MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
}
inline void wt_L(char a){
  my_putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    my_putchar_unlocked('-');
  }
  while(s--){
    my_putchar_unlocked(f[s]+'0');
  }
}
int N;
long long A[200000];
long long B[200000];
long long t2[200000];
long long t5[200000];
long long ct[101][101];
char in[100];
int main(){
  int i, x1;
  int len;
  long long res = 0;
  rd(N);
  for(i=(0);i<(N);i++){
    int j, k;
    len = rd(in);
    for(k=(0);k<(len);k++){
      if(in[k]=='.'){
        break;
      }
    }
    if(k==len){
      in[len++] = '.';
    }
    B[i] = 1;
    while(k < len-1){
      B[i] *= 10;
      swap(in[k], in[k+1]);
      k++;
    }
    A[i] = 0;
    for(j=(0);j<(k);j++){
      A[i] = 10 * A[i] + in[j] - '0';
    }
    while(A[i]%2==0){
      t2[i]++;
      A[i]/=2;
    }
    while(A[i]%5==0){
      t5[i]++;
      A[i]/=5;
    }
    while(B[i]%2==0){
      t2[i]--;
      B[i]/=2;
    }
    while(B[i]%5==0){
      t5[i]--;
      B[i]/=5;
    }
  }
  for(i=(0);i<(N);i++){
    ct[t2[i]+12][t5[i]+12]++;
  }
  for(x1=(0);x1<(61);x1++){
    int y1;
    for(y1=(0);y1<(61);y1++){
      if(ct[x1][y1]){
        int x2;
        for(x2=(0);x2<(61);x2++){
          int y2;
          for(y2=(0);y2<(61);y2++){
            if(ct[x2][y2]){
              if(x1 + x2 >= 24 && y1 + y2 >= 24){
                res += ct[x1][y1] * ct[x2][y2];
              }
            }
          }
        }
      }
    }
  }
  for(i=(0);i<(N);i++){
    if(t2[i] >= 0 && t5[i] >= 0){
      res--;
    }
  }
  assert(res % 2 == 0);
  res /= 2;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200509-1

// --- original code ---
// int N;
// ll A[2d5], B[2d5];
// ll t2[2d5], t5[2d5];
// ll ct[101][101];
// char in[100];
// {
//   int len;
//   ll res = 0;
//   rd(N);
//   rep(i,N){
//     rd(in@len);
//     rep(k,len) if(in[k]=='.') break;
//     if(k==len) in[len++] = '.';
// 
//     B[i] = 1;
//     while(k < len-1){
//       B[i] *= 10;
//       swap(in[k], in[k+1]);
//       k++;
//     }
//     A[i] = 0;
//     rep(j,k) A[i] = 10 * A[i] + in[j] - '0';
// 
//     while(A[i]%2==0) t2[i]++, A[i]/=2;
//     while(A[i]%5==0) t5[i]++, A[i]/=5;
//     while(B[i]%2==0) t2[i]--, B[i]/=2;
//     while(B[i]%5==0) t5[i]--, B[i]/=5;
//   }
// 
//   rep(i,N) ct[t2[i]+12][t5[i]+12]++;
//   rep(x1,61) rep(y1,61) if(ct[x1][y1]) rep(x2,61) rep(y2,61) if(ct[x2][y2]){
//     if(x1 + x2 >= 24 && y1 + y2 >= 24) res += ct[x1][y1] * ct[x2][y2];
//   }
//   rep(i,N) if(t2[i] >= 0 && t5[i] >= 0) res--;
//   assert(res % 2 == 0);
//   res /= 2;
//   wt(res);
// }


Measured memory_bytes: 10940