#include <bits/stdtr1c++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using pii = pair<int, int>;

#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define sz size()
#define SZ(x) int(x.size())
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define quix ios_base::sync_with_stdio(0);cin.tie(0);
#define binary(n, len) cout << bitset<len>(n) << '\n'
#define rr read
#define ww write
#ifndef ONLINE_JUDGE 
#include "/home/asif/Codes/Library/debug.h"
#endif

//IO

template<typename T>
inline void read(T& t){
  t = 0; char f = 0, ch = getchar();
  double d = 0.1;
  while(ch > '9' or ch < '0') f |= (ch == '-'), ch = getchar();
  while(ch <='9' and ch >= '0') t = t * 10 + ch - 48,ch = getchar();
  if(ch == '.') {
    ch = getchar();
    while(ch <= '9' && ch >= '0') t += d * (ch^48), d *= 0.1, ch = getchar();
  }
  t = ( f ? -t : t);
}
template<typename T, typename... Args>
inline void read(T& t, Args&... args){ read(t); read(args...);}

template<typename T>
void write(T t){ cout << t << '\n'; }
template <typename T, typename... Args>
void write(T t, Args... args) {
  cout << t << ' '; write(args...);
}

template<typename T>
void write(std::vector<T> &v){
  for(int i = 0; i < v.sz; i++)cout << v[i] << " \n" [i == SZ(v) - 1];
}

// Characters and Strings

bool isLetter(char c) { return (c >= 'A' and c <= 'Z') or (c >= 'a' and c <= 'Z');}
bool isUpperCase(char c){ return c >= 'A' and c <= 'Z'; }
bool isLowerCase(char c){ return c >= 'a' and c <= 'z';}
bool isDigit(char c){ return c >= '0' and c <= '9'; }
bool isVowel(char c){ return c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u'; }
bool isConsonant(char c){ return !isVowel(c); }

template<class T> 
string toString(T n){
  ostringstream ost;
  ost << n; ost.flush();
  return ost.str();
}

// Bit Hacks

ll setBit(ll mask, int p){ return (mask | (1 << p)); }
ll resetBit(ll mask, int p){ return (mask & ~(1 << p)); }
ll flipBit(ll mask, int p){ return (mask ^ (1 << p)); }
bool check(ll mask, int p){ return (mask & (1 << p)); }

int msb(long long N){ return N ? 63 - __builtin_clzll(N): -1; }
int lsb(long long N){ return __builtin_ffs(N) - 1;}
int countOn(ll mask){ return __builtin_popcountll(mask); }
int countOff(ll mask){ return msb(mask) - countOn(mask) + 1; }

// Math

ll nC2(ll n) { return (n * (n - 1)) / 2; }
ll nc3(ll n) { return (n * (n - 1) * (n - 2)) / 6; }

ll apsum(ll n, ll a = 1, ll d = 1){ return (n * (a + a + (n - 1) * d) ) / 2; }

ll lcm(ll a, ll b){ return (a / __gcd(a, b) ) * b; }

ll sqr(ll n){ return n * n; }
ll cub(ll n){ return n * n * n; }

template<typename A, typename P>
int bigMod(A a, P p, const int MOD){
  int ret = 1;
  while(p){
    if(p & 1)ret = (1LL * ret * a) % MOD;
    a = (1LL * a * a) % MOD;
    p >>= 1LL;
  }
  return ret;
}

template<typename T>
T toBase(T n, T base){
  T ret = 0LL;
  while(n){
    ret += n % base;
    ret *= 10LL;
    n /= base;
  }
  return ret;
}

template<class T> struct Fraction{T a, b; Fraction(T a = 0,T b = 1); string toString();};
template<class T> Fraction<T>::Fraction(T a,T b){T d=__gcd(a,b);a/=d;b/=d;if (b<0) a=-a,b=-b;this->a=a;this->b=b;}
template<class T> string Fraction<T>::toString(){ostringstream sout;sout<<a<<" / "<<b;return sout.str();}
template<class T> Fraction<T> operator+(Fraction<T> p,Fraction<T> q){return Fraction<T>(p.a*q.b+q.a*p.b,p.b*q.b);}
template<class T> Fraction<T> operator-(Fraction<T> p,Fraction<T> q){return Fraction<T>(p.a*q.b-q.a*p.b,p.b*q.b);}
template<class T> Fraction<T> operator*(Fraction<T> p,Fraction<T> q){return Fraction<T>(p.a*q.a,p.b*q.b);}
template<class T> Fraction<T> operator/(Fraction<T> p,Fraction<T> q){return Fraction<T>(p.a*q.b,p.b*q.a);}
template<class T> bool operator<(Fraction<T> p,Fraction<T> q){return 1LL * p.a * q.b < 1LL * p.b * q.a;}
template<class T> bool operator==(Fraction<T> p, Fraction<T> q){return p.a == q.a and p.b == q.b;}

// Misc

ll rand(ll l, ll r) { //[l, r]
  #ifdef LOCAL
  static mt19937_64 gen;
  #else
  static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
  #endif
  return uniform_int_distribution<ll>(l, r)(gen);
}

template<typename T>
ll sumv(std::vector<T> &v){ return std::accumulate(all(v), 0LL); }

template<typename T>
T minv(std::vector<T> &v){ return *std::min_element(all(v)); }

template<typename T>
T maxv(std::vector<T> &v){ return *std::max_element(all(v)); }

template<typename T>
void make_unique(std::vector<T> &v){ sort(all(v)); v.resize(unique(all(v)) - v.begin()); }

template<typename T>
int lowerBound(std::vector<T> &v, T x){ return lower_bound(all(v), x) - v.begin(); }

template<typename T>
int upperBound(std::vector<T> &v, T x){ return upper_bound(all(v), x) - v.begin(); }

double startTime;
void showCurrentTime() { printf("%.6lf\n", ((double)clock() - startTime) / CLOCKS_PER_SEC); }

/*-------------------------------------------------------------------------------------------------------*/

const double EPS = 1e-9;
const double PI = acos(-1.0);
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
const int dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
const int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};

/*-------------------------------------------------------------------------------------------------------*/

ll mat[50][50];

int main() {

  int n;
  ll a, b;
  cin >> n;
  string s;
  for(int i = 0; i < n; i++){
    cin >> s;
    bool found = 0;
    for(int i = 0; i < s.sz; i++){
      if(s[i] == '.') {
        found = 1;
        s[i] = ' ';
        while(s.sz - i <= 9)s += "0";
      }
    }
    // cout << s << endl;
    stringstream ss(s);
    ss >> a;
    ll num = a * ll(1e9);
    if(found) {
      ss >> a; num += a;
    }
    int p2 = 0, p5 = 0;
    while(num % 2 == 0){
      p2++;
      num /= 2LL;
    }
    while(num % 5 == 0){
      p5++;
      num /= 5LL;
    }
    // ww(p2, p5);
    mat[p2][p5]++;
  }
  ll ans = 0;
  for(int i = 0; i < 50; i++){
    for(int j = 0; j < 50; j++){
      if(!mat[i][j]) continue;
      // ww(i, j, mat[i][j]);
      if(mat[i][j] >= 2 and 2 * i >= 18 and 2 * j >= 18) ans += nC2(mat[i][j]) * 2LL;
      for(int k = 0; k < 50; k++){
        for(int l = 0; l < 50; l++){
          if(!mat[k][l] or (i == k and j == l)) continue;
          // ww(i + k, j + l);
          if(i + k >= 18 and j + l >= 18) {
            // ww(i, j, k, l);
            ans += mat[i][j] * mat[k][l];
          }
        }
      }
    }
  }
  ans /= 2;
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 3704