#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#define int long long
using namespace std;
int a[200000];
signed main(){
	int n;
	string s;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s;
		int dot=100;
		for(int j=0;j<s.size();j++)
			if(s[j]=='.')
				dot=j;
		if(dot!=100){
			s.erase(s.begin()+dot);
			a[i]=stoll(s)*(int)round(pow(10,9-(s.size()-dot)));
		}else
			a[i]=stoll(s)*1000000000;
	}
	int dd[19][19]={};
	for(int i=0;i<n;i++){
		int a2=a[i],a5=a[i];
		int div2=0,div5=0;
		while(a2%2==0){
			a2/=2;
			div2++;
		}
		while(a5%5==0){
			a5/=5;
			div5++;
		}
		dd[min(18ll,div2)][min(18ll,div5)]++;
	}
	int ans=0;
	for(int i=0;i<=18;i++)
		for(int j=0;j<=18;j++)
			for(int k=18-i;k<=18;k++)
				for(int l=18-j;l<=18;l++)
					if(i==k&&j==l)
						ans+=dd[i][j]*(dd[i][j]-1);
					else
						ans+=dd[i][j]*dd[k][l];
	cout<<ans/2<<endl;
}
### Prompt

Please formulate a Cpp solution to the following problem:

You are given N real values A_1, A_2, \ldots, A_N. Compute the number of pairs of indices (i, j) such that i < j and the product A_i \cdot A_j is integer.

Constraints

* 2 \leq N \leq 200\,000
* 0 < A_i < 10^4
* A_i is given with at most 9 digits after the decimal.

Input

Input is given from Standard Input in the following format.


N
A_1
A_2
\vdots
A_N


Output

Print the number of pairs with integer product A_i \cdot A_j (and i < j).

Examples

Input

5
7.5
2.4
17.000000001
17
16.000000000


Output

3


Input

11
0.9
1
1
1.25
2.30000
5
70
0.000000001
9999.999999999
0.999999999
1.000000001


Output

8

### Response

```cpp
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#define int long long
using namespace std;
int a[200000];
signed main(){
	int n;
	string s;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s;
		int dot=100;
		for(int j=0;j<s.size();j++)
			if(s[j]=='.')
				dot=j;
		if(dot!=100){
			s.erase(s.begin()+dot);
			a[i]=stoll(s)*(int)round(pow(10,9-(s.size()-dot)));
		}else
			a[i]=stoll(s)*1000000000;
	}
	int dd[19][19]={};
	for(int i=0;i<n;i++){
		int a2=a[i],a5=a[i];
		int div2=0,div5=0;
		while(a2%2==0){
			a2/=2;
			div2++;
		}
		while(a5%5==0){
			a5/=5;
			div5++;
		}
		dd[min(18ll,div2)][min(18ll,div5)]++;
	}
	int ans=0;
	for(int i=0;i<=18;i++)
		for(int j=0;j<=18;j++)
			for(int k=18-i;k<=18;k++)
				for(int l=18-j;l<=18;l++)
					if(i==k&&j==l)
						ans+=dd[i][j]*(dd[i][j]-1);
					else
						ans+=dd[i][j]*dd[k][l];
	cout<<ans/2<<endl;
}
```