#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;

const int MAX = 18;

int main() {
	int n;
	cin >> n;
	ll ans = 0;

	vector<vector<ll>> c(MAX + 1, vector<ll>(MAX + 1));
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;


		ll a = 0;

		bool isD = false;
		int cnt = 0;
		for (int i = 0; i < s.length(); i++) {
			if (isD) {
				cnt++;
			}
			if (s[i] == '.') {
				isD = true;
				continue;
			}

			
			a = a * 10 + s[i] - '0';
		}

		while (cnt < 9) {
			a *= 10;
			cnt++;
		}

		
		//cout << a << endl;
		int cnt2 = 0;
		int cnt5 = 0;
		while (a % 2 == 0) {
			cnt2++;
			a /= 2;
		}

		cnt2 = min(cnt2, MAX);

		while (a % 5 == 0) {
			cnt5++;
			a /= 5;
		}


		cnt5 = min(cnt5, MAX);




		for (int i = 0; i <= MAX; i++) {
			if (i + cnt2 < MAX) {
				continue;
			}
			for (int j = 0; j <= MAX; j++) {
				if (j + cnt5 < MAX) {
					continue;
				}
				ans += c[i][j];
			}
		}
		




		
		c[cnt2][cnt5]++;

	}
	cout << ans << endl;
	
	/*
	cout.fill(' ');
	cout << "   ";
	for (int i = 0; i <= MAX; i++) {
		cout << setw(2) << i << " ";
	}
	cout << endl;
	for (int i = 0; i <= MAX; i++) {
		cout << setw(2) << i << " ";
		for (int j = 0; j <= MAX; j++) {
			cout << setw(2) << c[i][j] << " ";
		}
		cout << setw(2) << endl;
	}
	*/

}
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
using namespace std;
void read(int &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void read(ll &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void Min(int &x,int y){	
	if (x>y)x=y;
}
void Min(ll &x,ll y){	
	if (x>y)x=y;
}
void Max(int &x,int y){	
	if (x<y)x=y;
}
void Max(ll &x,ll y){	
	if (x<y)x=y;
}

#define bas 50
ll cnt[105][105];
char s[50];
int main(){
//	freopen("1.in","r",stdin);
	int n,i,j,k,l;
	ll x,res=0;
	
	read(n);
	/*
		cnt2[i]+cnt2[j]>=0
		cnt5[i]+cnt5[j]>=0	
	*/
	int m,ct2,ct5;
	for (i=1;i<=n;i++){
		scanf("%s",s);
		m=strlen(s);
		x=0; ct2=ct5=0;
		for (j=0;j<m;j++){
			if (s[j]!='.'){
				x=(x<<1)+(x<<3)+(s[j]^48);
			}
			else{
				ct2-=m-j-1;
				ct5-=m-j-1;
			}
		}
		for (;x&&x%2==0;)x/=2,ct2++;
		for (;x&&x%5==0;)x/=5,ct5++;
		cnt[bas+ct2][bas+ct5]++;
		if (ct2>=0&&ct5>=0)res--;
//		printf("%d %d\n",ct2,ct5);
	}
	for (i=-50;i<=50;i++){
		for (j=-50;j<=50;j++)if (cnt[i+bas][j+bas]){
			for (k=-i;k<=50;k++){
				for (l=-j;l<=50;l++){
					res+=cnt[i+bas][j+bas]*cnt[k+bas][l+bas];
				}
			}
		}
	}
	printf("%lld\n",res/2);
	return 0;
}