#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 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;
  long long A;
  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++] = '.';
    }
    while(k < len-1){
      t2[i]--;
      t5[i]--;
      swap(in[k], in[k+1]);
      k++;
    }
    A = 0;
    for(j=(0);j<(k);j++){
      A = 10 * A + in[j] - '0';
    }
    while(A%2==0){
      t2[i]++;
      A/=2;
    }
    while(A%5==0){
      t5[i]++;
      A/=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--;
    }
  }
  res /= 2;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200509-1

// --- original code ---
// int N;
// ll t2[2d5], t5[2d5];
// ll ct[101][101];
// char in[100];
// {
//   int len;
//   ll res = 0, A;
//   rd(N);
//   rep(i,N){
//     rd(in@len);
//     rep(k,len) if(in[k]=='.') break;
//     if(k==len) in[len++] = '.';
// 
//     while(k < len-1){
//       t2[i]--;
//       t5[i]--;
//       swap(in[k], in[k+1]);
//       k++;
//     }
//     A = 0;
//     rep(j,k) A = 10 * A + in[j] - '0';
// 
//     while(A%2==0) t2[i]++, A/=2;
//     while(A%5==0) t5[i]++, A/=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--;
//   res /= 2;
//   wt(res);
// }


Measured memory_bytes: 7660