#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<vector<ll>>
#define VV(a, b, c, d) vector<vector<d>>(a, vector<d>(b, c))
#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;
struct segtree {
  ll H, W, INF = 1000000000000000000;
  vvl dat;
  segtree(ll h, ll w, ll num) {
    H = W = 1;
    while(H < h) H <<= 1;
    while(W < w) W <<= 1;
    dat.assign(2*H-1,vll(2*W-1,num));
  }
  void insert(ll i, ll j, ll x){
    i+=H-1, j+=W-1;
    dat[i][j] += x;
    ll tmp_i = i;
    while(tmp_i>0){
      tmp_i = (tmp_i-1)/2;
      dat[tmp_i][j] = dat[tmp_i*2+1][j] + dat[tmp_i*2+2][j];
    }
    ll tmp_j = j;
    while(tmp_j>0){
      tmp_j = (tmp_j-1)/2;
      dat[i][tmp_j] = dat[i][tmp_j*2+1] + dat[i][tmp_j*2+2];
    }
    while(i>0){
      i = (i-1)/2;
      tmp_j = j;
      while(tmp_j>0){
        tmp_j = (tmp_j-1)/2;
        dat[i][tmp_j] = dat[i][tmp_j*2+1] + dat[i][tmp_j*2+2];
      }
    }
  }
  ll find(int a, int b, int A, int B) { return find_h(a,b,A,B,0,H,0); }
  ll find_h(int a, int b, int A, int B, int l, int r, int k) {
    if(r<=a||b<=l) return 0;
    if(a<=l&&r<=b) return find_w(A,B,0,W,k,0);
    return find_h(a,b,A,B,l,(l+r)/2,2*k+1) + find_h(a,b,A,B,(l+r)/2,r,2*k+2);
  }
  ll find_w(int A, int B, int l, int r, int i, int k) {
    if(r<=A||B<=l) return 0;
    if(A<=l&&r<=B) return dat[i][k];
    return find_w(A,B,l,(l+r)/2,i,2*k+1) + find_w(A,B,(l+r)/2,r,i,2*k+2);
  }
};
int main(int argc, char const *argv[]) {
  ll n;std::cin >> n;
  vvl d = VV(n, 2, 0, ll);
  for(int i=0;i<n;i++){
    string s;std::cin >> s;
    bool f = false;
    bool g = true;
    string ret = "";
    for(int j=0;j<s.size();j++){
      if(s[j]=='.') f = true;
      if(f) ret += s[j];
      if(f&&s[j]!='0') g = false;
    }

    //整数
    if(g) d[i] = {stoll(s), 0};
    else{
      ll cnt = 0;
      for(int j=ret.size()-1;j>=0;j--){
        if(ret[j]=='0') cnt++;
        else break;
      }
      if(cnt==ret.size()-1){
        d[i] = {stoll(s), 0};
        continue;
      }

      string ad = "";
      ll bk = 0;
      bool y = false;

      for(int j=0;j<s.size()-cnt;j++){
        if(s[j]=='.') y = true;
        else if(y) bk++, ad += s[j];
        else ad += s[j];
      }
      d[i] = {stoll(ad), bk};
    }
  }
  vvl x = VV(n, 2, 0, ll);
  for(int i=0;i<n;i++){
    ll cnt = 0;
    ll num = d[i][0];
    while(num%2==0){
      num/=2, cnt++;
    }
    x[i][0] = cnt;
    cnt = 0;
    while(num%5==0){
      num/=5, cnt++;
    }
    x[i][1] = cnt;
    ll need = d[i][1];
    x[i][0] -= need, x[i][1] -= need;
  }

  /*
  for(int i=0;i<n;i++){
    std::cout << x[i][0] << " " << x[i][1] << '\n';
  }
  */
  segtree seg(500, 500, 0);
  ll th = 200;
  ll ans = 0;
  for(int i=0;i<n;i++){
    ll X = x[i][0], Y = x[i][1];
    ll q = seg.find(-X+th, 500, -Y+th, 500);
    ans += q;
    seg.insert(X+th, Y+th, 1);
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 33068