#include<bits/stdc++.h>
using namespace std;
int n,c[20][20];
long long ans,tmp;
int main(){
//	freopen("A.in","r",stdin);
//	freopen("A.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;++i){
		double x;
		int t1=0,t2=0;
		scanf("%lf",&x);
		tmp=(long long )(x*1e9+0.5);
		while(tmp%2==0)tmp/=2,t1++;
		while(tmp%5==0)tmp/=5,t2++;
		t1=min(t1,18),t2=min(t2,18);
		for(int j=0;j<=18;++j)
		for(int k=0;k<=18;++k){
			if(min(t1+j,t2+k)>=18)ans+=c[j][k];
		}
		c[t1][t2]++;
	//	cout<<ans<<endl;
	}
	cout<<ans<<endl;
	/*(int i=0;i<=10;++i){
		for(int j=0;j<=10;++j)printf("%d ",c[i][j]);
		puts("");
	}*/
	return 0;
} 