#include <cstdio>
#include <cstring>
#include <cctype>

typedef long long LL;

int N;
int buk[19][19];
LL Ans;

int main() {
	scanf("%d", &N);
	for (int i = 1; i <= N; ++i) {
		char S[19];
		scanf("%s", S + 1);
		int len = strlen(S + 1);
		int pos = len;
		while (pos > 1 && isdigit(S[pos - 1])) --pos;
		if (pos == 1) pos = len + 2;
		LL x = 0;
		for (int j = 1; j < pos - 1; ++j)
			x = x * 10 + (S[j] - '0');
		for (int j = 0; j < 9; ++j)
			x = x * 10 + (pos + j <= len ? S[pos + j] - '0' : 0);
		int c2 = 0, c5 = 0;
		while (x % 2 == 0) ++c2, x /= 2;
		while (x % 5 == 0) ++c5, x /= 5;
		if (c2 > 18) c2 = 18;
		if (c5 > 18) c5 = 18;
		int t2 = 18 - c2, t5 = 18 - c5;
		for (int i2 = t2; i2 <= 18; ++i2)
			for (int i5 = t5; i5 <= 18; ++i5)
				Ans += buk[i2][i5];
		++buk[c2][c5];
	}
	printf("%lld\n", Ans);
	return 0;
}
### Prompt

Please provide a cpp coded solution to the problem described below:

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 <cstring>
#include <cctype>

typedef long long LL;

int N;
int buk[19][19];
LL Ans;

int main() {
	scanf("%d", &N);
	for (int i = 1; i <= N; ++i) {
		char S[19];
		scanf("%s", S + 1);
		int len = strlen(S + 1);
		int pos = len;
		while (pos > 1 && isdigit(S[pos - 1])) --pos;
		if (pos == 1) pos = len + 2;
		LL x = 0;
		for (int j = 1; j < pos - 1; ++j)
			x = x * 10 + (S[j] - '0');
		for (int j = 0; j < 9; ++j)
			x = x * 10 + (pos + j <= len ? S[pos + j] - '0' : 0);
		int c2 = 0, c5 = 0;
		while (x % 2 == 0) ++c2, x /= 2;
		while (x % 5 == 0) ++c5, x /= 5;
		if (c2 > 18) c2 = 18;
		if (c5 > 18) c5 = 18;
		int t2 = 18 - c2, t5 = 18 - c5;
		for (int i2 = t2; i2 <= 18; ++i2)
			for (int i5 = t5; i5 <= 18; ++i5)
				Ans += buk[i2][i5];
		++buk[c2][c5];
	}
	printf("%lld\n", Ans);
	return 0;
}
```