from collections import defaultdict



def conv(s):

    if "." not in s:

        s += '.'

    s = s.rstrip('0')

    t = len(s) - s.find('.') - 1

    a = int(s.replace('.', ''))

    if a == 0:

        return (0, 0)

    x, y = -t, -t

    while a % 5 == 0:

        x += 1

        a //= 5

    y += len(bin(a&-a))-3

    return (x, y)



_, *A = open(0).read().split()



d = defaultdict(int)

for a in A:

    d[conv(a)] += 1



result = 0

d = list(d.items())

for i, ((x, y), cnt) in enumerate(d):

    if x >= 0 and y >= 0:

        result += cnt * (cnt - 1) // 2

    for (m, n), cnt2 in d[i+1:]:

        if x + m >= 0 and y + n >= 0:

            result += cnt * cnt2

print(result)

import sys

from collections import defaultdict

from math import gcd



def input(): return sys.stdin.readline().strip()



K = 10**9

L = 10**18

D = defaultdict(int)

for _ in range(int(eval(input()))):

    D[gcd(round(float(eval(input())) * K), L)] += 1



D = tuple(D.items())

ans = 0

for i, (k1, v1) in enumerate(D):

    if k1*k1 % L == 0:

        ans += v1*(v1-1) // 2

    for k2, v2 in D[i+1:]:

        if k1*k2 % L == 0:

            ans += v1 * v2

print(ans)

from collections import defaultdict


def conv(s):
    if "." not in s:
        s += "."
    s = s.rstrip("0")
    t = len(s) - s.find(".") - 1
    a = int(s.replace(".", ""))
    if a == 0:
        return (0, 0)
    x, y = -t, -t
    while a % 5 == 0:
        x += 1
        a //= 5
    y += len(bin(a & -a)) - 3
    return (x, y)


_, *A = open(0).read().split()
d = defaultdict(int)
for a in A:
    d[conv(a)] += 1
result = 0
d = list(d.items())
for i, ((x, y), cnt) in enumerate(d):
    if x >= 0 and y >= 0:
        result += cnt * (cnt - 1) // 2
    for (m, n), cnt2 in d[i + 1 :]:
        if x + m >= 0 and y + n >= 0:
            result += cnt * cnt2
print(result)

import sys
from collections import defaultdict
from math import gcd


def input():
    return sys.stdin.readline().strip()


K = 10**9
L = 10**18
D = defaultdict(int)
for _ in range(int(eval(input()))):
    D[gcd(round(float(eval(input())) * K), L)] += 1
D = tuple(D.items())
ans = 0
for i, (k1, v1) in enumerate(D):
    if k1 * k1 % L == 0:
        ans += v1 * (v1 - 1) // 2
    for k2, v2 in D[i + 1 :]:
        if k1 * k2 % L == 0:
            ans += v1 * v2
print(ans)

+import sys +from math import gcd -def conv(s): -    if "." not in s: -        s += "." -    s = s.rstrip("0") -    t = len(s) - s.find(".") - 1 -    a = int(s.replace(".", "")) -    if a == 0: -        return (0, 0) -    x, y = -t, -t -    while a % 5 == 0: -        x += 1 -        a //= 5 -    y += len(bin(a & -a)) - 3 -    return (x, y) +def input(): +    return sys.stdin.readline().strip() -_, *A = open(0).read().split() -d = defaultdict(int) -for a in A: -    d[conv(a)] += 1 -result = 0 -d = list(d.items()) -for i, ((x, y), cnt) in enumerate(d): -    if x >= 0 and y >= 0: -        result += cnt * (cnt - 1) // 2 -    for (m, n), cnt2 in d[i + 1 :]: -        if x + m >= 0 and y + n >= 0: -            result += cnt * cnt2 -print(result) +K = 10**9 +L = 10**18 +D = defaultdict(int) +for _ in range(int(eval(input()))): +    D[gcd(round(float(eval(input())) * K), L)] += 1 +D = tuple(D.items()) +ans = 0 +for i, (k1, v1) in enumerate(D): +    if k1 * k1 % L == 0: +        ans += v1 * (v1 - 1) // 2 +    for k2, v2 in D[i + 1 :]: +        if k1 * k2 % L == 0: +            ans += v1 * v2 +print(ans)