#include<cstdio>
#include<iostream>
#include<cctype>
#define RI register int
#define CI const int&
using namespace std;
typedef long long LL;
int n,c[100][100],lim2,lim5; LL ans,ret; double x;
int main()
{
	RI i,j,p,q; for (scanf("%d\n",&n),i=1;i<=n;++i)
	{
		char ch; LL v=0; while (isdigit(ch=getchar())) v=v*10+ch-'0';
		if (ch=='\n') v*=(LL)1e9; else
		{
			int p=0; while (isdigit(ch=getchar())) v=v*10+ch-'0',++p;
			while (p<9) v*=10LL,++p;
		}
		int c2=0,c5=0;
		while (v%2==0) v/=2,++c2; while (v%5==0) v/=5,++c5;
		++c[c2][c5]; lim2=max(lim2,c2); lim5=max(lim5,c5);
		//printf("%d %d\n",c2,c5);
	}
	for (i=0;i<=lim2;++i) for (j=0;j<=lim5;++j)
	for (p=0;p<=lim2;++p) for (q=0;q<=lim5;++q)
	if (i+p>=18&&j+q>=18) 
	{
		if (i!=p||j!=q) ans+=1LL*c[i][j]*c[p][q];
		else ret+=(1LL*c[i][j]*(c[i][j]-1)>>1LL);
	}
	return printf("%lld",(ans>>1LL)+ret),0;
}
### Prompt

Create a solution in Cpp for 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<cstdio>
#include<iostream>
#include<cctype>
#define RI register int
#define CI const int&
using namespace std;
typedef long long LL;
int n,c[100][100],lim2,lim5; LL ans,ret; double x;
int main()
{
	RI i,j,p,q; for (scanf("%d\n",&n),i=1;i<=n;++i)
	{
		char ch; LL v=0; while (isdigit(ch=getchar())) v=v*10+ch-'0';
		if (ch=='\n') v*=(LL)1e9; else
		{
			int p=0; while (isdigit(ch=getchar())) v=v*10+ch-'0',++p;
			while (p<9) v*=10LL,++p;
		}
		int c2=0,c5=0;
		while (v%2==0) v/=2,++c2; while (v%5==0) v/=5,++c5;
		++c[c2][c5]; lim2=max(lim2,c2); lim5=max(lim5,c5);
		//printf("%d %d\n",c2,c5);
	}
	for (i=0;i<=lim2;++i) for (j=0;j<=lim5;++j)
	for (p=0;p<=lim2;++p) for (q=0;q<=lim5;++q)
	if (i+p>=18&&j+q>=18) 
	{
		if (i!=p||j!=q) ans+=1LL*c[i][j]*c[p][q];
		else ret+=(1LL*c[i][j]*(c[i][j]-1)>>1LL);
	}
	return printf("%lld",(ans>>1LL)+ret),0;
}
```