/***

    Muhammad Imdad-Ul-Haque Rakib(Attari)
    CSE'19
    Chittagong,Bangladesh

***/


#include<bits/stdc++.h>


/**Definitions**/


#define   ld             long double
#define   ll             long long
#define   boost_         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define   pb             push_back
#define   ppb            pop_back
#define   ull            unsigned long long
#define   over           return 0
#define   scan(i,n,a)    for(i=0;i<n;i++) cin>>a[i]
#define   MP             make_pair
#define   spc            " "

using namespace std;


/** Predefined Functions **/


int gcd(int x,int y){
    if(x==0) return y;
    else return gcd(y%x,x);
}
bool sortbysec(const pair<int,int>&a, const pair<int,int>&b){ return (a.second<b.second); }
bool sortbysecinrev(const pair<int,int>&a, const pair<int,int>&b){ return (a.second>b.second); }
bool sortbysize(string &s1,string &s2){ return s1.size() < s2.size(); }
bool sortinrev(const pair<int,int> &a, const pair<int,int> &b){ return (a.first > b.first); }


/** Main Function **/


int main(){

    boost_;
    ll n;
    cin>>n;
    ll a[n],i,a1=0,a2=0,a3=0;
    vector<ll>v,q;
    map<ll,ll>mp;
    scan(i,n,a);

    sort(a,a+n,greater<int>());

    for(i=0;i<n;++i){
        mp[a[i]]++;
        if(mp[a[i]]==1) q.pb(a[i]);
    }

    for(i=0;i<q.size();++i){
        if(mp[q[i]]>=2) v.pb(q[i]);
        if(v.size()==2) break;
    }
    if(v.size()==0) cout<<0<<endl;
    else{

       if(v.size()==1){if(mp[v[0]]>=4) cout<<v[0]*v[0]<<endl; else cout<<0<<endl;}
       else{
           if(mp[v[0]]>=4) cout<<v[0]*v[0]<<endl;
           else cout<<v[0]*v[1]<<endl;
       }
    }


    over;
}

#include "assert.h"
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <vector>

using namespace std;

#define rep(i, a, n) for (int i = a; i <= n; ++i)
#define per(i, n, a) for (int i = n; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long LL;
typedef pair<int, int> PII;
mt19937 mrand(random_device{}());

inline int in() {
  char ch = getchar();
  int f = 1, x = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-')
      f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return f * x;
}

const int inf = (1 << 30);
const int mod = 998244353;
const int N = 100010;

LL cnt[50][30];

int main() {
#ifndef ONLINE_JUDGE
  freopen("in.in", "r", stdin);
  // freopen("out.out", "w", stdout);
#endif
  int n = in();
  int tmp = 1e9, A = 0, B = 0;
  while (tmp % 2 == 0)
    ++A, tmp /= 2;
  while (tmp % 5 == 0)
    ++B, tmp /= 5;
  cerr << A << " " << B << endl;
  LL ans = 0;
  rep(_, 1, n) {
    double x;
    cin >> x;
    LL tmp = llround(x * 1e9) ;
    int a = 0, b = 0;
    while (tmp % 2 == 0)
      ++a, tmp /= 2;
    while (tmp % 5 == 0)
      ++b, tmp /= 5;
    rep(i, 0, 49) rep(j, 0, 29) {
      if (i + a >= A * 2 && j + b >= B * 2)
        ans += cnt[i][j];
    }
    cnt[a][b]++;
    cerr << ans << endl;
  }
  cout << ans << endl;
  return 0;
}
