#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cmath>
using namespace std;
typedef unsigned long long LL;
LL a[200055];
const int MX=1e9;
const LL MAX=1e18;
inline LL mul(LL a,LL b,LL mod){
	return
	(a*b-(LL)((long double)a/mod*b)*mod+mod)%mod;
}
int n;
void brute(){
	int ans=0;
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			if(mul(a[i],a[j],MAX)==0)ans++;//,cout<<i<<' '<<j<<endl;
		}
	}
	cout<<ans<<endl;
	exit(0);
}
struct num{int two,fiv,id;}y[200055];
bool cmp1(num a,num b){return a.two<b.two;}
struct ques{int l,w;}q[100055];
bool cmp2(num a,num b){return a.fiv>b.fiv;}
bool cmp3(ques a,ques b){return a.w>b.w;}

struct TreeArry{
#define lowbit(i) ((i)&(-(i)))
	LL tree[100055],n;
	inline void add(int a,LL b)
		{for(;a<=n;a+=lowbit(a))tree[a]+=b;}
	inline int sum(int l,int r){
		int res=0;l--;
		while(r>l)res+=tree[r],r-=lowbit(r);
		while(l>r)res-=tree[l],l-=lowbit(l);
		return res;
	}
}S;

int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		double t;
		cin>>t;
		a[i]=round((long double)t*MX);
	}
	//for(int i=1;i<=n;i++)cout<<a[i]<<' ';cout<<endl;
	//brute();
	for(int i=1;i<=n;i++){
		while(a[i]%2==0)y[i].two++,a[i]/=2;
		while(a[i]%5==0)y[i].fiv++,a[i]/=5;
	}
	LL ans=0;
	//for(int i=1;i<=n;i++)cout<<y[i].two<<' ';cout<<endl;//
	//for(int i=1;i<=n;i++)cout<<y[i].fiv<<' ';cout<<endl;//
	//cout<<"_____\n";//
	sort(y+1,y+n+1,cmp1);
	//for(int i=1;i<=n;i++)cout<<y[i].two<<' ';cout<<endl;//
	//for(int i=1;i<=n;i++)cout<<y[i].fiv<<' ';cout<<endl;//
	for(int i=1;i<=n;i++){
		q[i].l=lower_bound(y+1,y+n+1,(num){max(0,18-y[i].two),0,-1},cmp1)-y;
		q[i].w=max(0,18-y[i].fiv);
		if(max(0,18-y[i].two)<=y[i].two&&max(0,18-y[i].fiv)<=y[i].fiv)ans--;//,cout<<i<<',';//
	}//cout<<endl;
	//for(int i=1;i<=n;i++)cout<<q[i].l<<' ';cout<<endl;//
	//for(int i=1;i<=n;i++)cout<<q[i].w<<' ';cout<<endl;//
	//cout<<ans<<endl;
	for(int i=1;i<=n;i++)y[i].id=i;
	sort(y+1,y+n+1,cmp2);
	sort(q+1,q+n+1,cmp3);
	S.n=n;
	for(int i=1,l=1;i<=n;i++){
		while(y[l].fiv>=q[i].w&&l<=n)S.add(y[l].id,1),l++;
		ans+=S.sum(q[i].l,n);//cout<<ans<<endl;
	}
	cout<<ans/2<<endl;
}