def five(x):

    cnt1 = 0

    while x%5==0:

        cnt1+= 1

        x = x//5

    cnt2 = 0

    while x%2==0:

        cnt2+= 1

        x = x//2

    return (min2(cnt1,18), min2(cnt2,18))



def min2(x,y):

    return x if x < y else y



import sys

input = sys.stdin.readline



N = int(eval(input()))

F = []

for i in range(N):

    A = input().rstrip()

    if '.' in A:

        a,b = A.split('.')

        n = int(a+b)*10**(9-len(b))

    else:

        n = int(A) * 10 ** 9

    F.append(five(n))



F.sort()

j = 0

temp = 0

dp = [0]*19

k = 0

for i in range(N-1):

    if N-1-j < i:

        dp[min2(F[i][1], 18)] -= 1

    while N-1-j> i and F[i][0]+F[N-1-j][0] >= 18:

        dp[min2(F[N-1-j][1],18)] += 1

        j += 1

    k = sum(dp[:18-F[i][1]])

    temp += min2(j, N-i-1) - k



print(temp)

class cumsum2D:

    def __init__(self, data):

        self.N = len(data)

        self.M= len(data[0])

        self.cum = [[0] * (self.M + 1) for _ in range(self.N + 1)]

        for i in range(self.N):

            for j in range(self.M):

                self.cum[i + 1][j + 1] = self.cum[i][j + 1] + self.cum[i + 1][j] - self.cum[i][j] + data[i][j]



    def get(self,x1,y1,x2,y2):

        """

        長方形の領域 [x1,x2)*[y1,y2) の範囲内にインプットされた数字の和を取る

        """

        return self.cum[x2][y2] - self.cum[x1][y2] - self.cum[x2][y1] + self.cum[x1][y1]



def five(x):

    cnt1 = 0

    while x%5==0:

        cnt1+= 1

        x = x//5

    cnt2 = 0

    while x%2==0:

        cnt2+= 1

        x = x//2

    return (min(cnt1,18), min(cnt2,18))



def digit_lift(S, l):

    if '.' in S:

        a, b = S.split('.')

        n = int(a + b) * 10 ** (l - len(b))

    else:

        n = int(S) * 10 ** l

    return n



data = [[0]*19 for _ in range(19)]



N = int(eval(input()))

Q = set()

for _ in range(N):

    A = digit_lift(input().rstrip(),9)

    x, y = five(A)

    data[x][y] += 1

    Q.add((x,y))



cum = cumsum2D(data)

res = 0

for x, y in Q:

    res += (cum.get(18-x,18-y,-1,-1)- (x>=9 and y>=9))*data[x][y]

print((res//2))
def five(x):
    cnt1 = 0
    while x % 5 == 0:
        cnt1 += 1
        x = x // 5
    cnt2 = 0
    while x % 2 == 0:
        cnt2 += 1
        x = x // 2
    return (min2(cnt1, 18), min2(cnt2, 18))


def min2(x, y):
    return x if x < y else y


import sys

input = sys.stdin.readline
N = int(eval(input()))
F = []
for i in range(N):
    A = input().rstrip()
    if "." in A:
        a, b = A.split(".")
        n = int(a + b) * 10 ** (9 - len(b))
    else:
        n = int(A) * 10**9
    F.append(five(n))
F.sort()
j = 0
temp = 0
dp = [0] * 19
k = 0
for i in range(N - 1):
    if N - 1 - j < i:
        dp[min2(F[i][1], 18)] -= 1
    while N - 1 - j > i and F[i][0] + F[N - 1 - j][0] >= 18:
        dp[min2(F[N - 1 - j][1], 18)] += 1
        j += 1
    k = sum(dp[: 18 - F[i][1]])
    temp += min2(j, N - i - 1) - k
print(temp)

class cumsum2D:
    def __init__(self, data):
        self.N = len(data)
        self.M = len(data[0])
        self.cum = [[0] * (self.M + 1) for _ in range(self.N + 1)]
        for i in range(self.N):
            for j in range(self.M):
                self.cum[i + 1][j + 1] = (
                    self.cum[i][j + 1]
                    + self.cum[i + 1][j]
                    - self.cum[i][j]
                    + data[i][j]
                )

    def get(self, x1, y1, x2, y2):
        """
        長方形の領域 [x1,x2)*[y1,y2) の範囲内にインプットされた数字の和を取る
        """
        return self.cum[x2][y2] - self.cum[x1][y2] - self.cum[x2][y1] + self.cum[x1][y1]


def five(x):
    cnt1 = 0
    while x % 5 == 0:
        cnt1 += 1
        x = x // 5
    cnt2 = 0
    while x % 2 == 0:
        cnt2 += 1
        x = x // 2
    return (min(cnt1, 18), min(cnt2, 18))


def digit_lift(S, l):
    if "." in S:
        a, b = S.split(".")
        n = int(a + b) * 10 ** (l - len(b))
    else:
        n = int(S) * 10**l
    return n


data = [[0] * 19 for _ in range(19)]
N = int(eval(input()))
Q = set()
for _ in range(N):
    A = digit_lift(input().rstrip(), 9)
    x, y = five(A)
    data[x][y] += 1
    Q.add((x, y))
cum = cumsum2D(data)
res = 0
for x, y in Q:
    res += (cum.get(18 - x, 18 - y, -1, -1) - (x >= 9 and y >= 9)) * data[x][y]
print((res // 2))

+class cumsum2D: +    def __init__(self, data): +        self.N = len(data) +        self.M = len(data[0]) +        self.cum = [[0] * (self.M + 1) for _ in range(self.N + 1)] +        for i in range(self.N): +            for j in range(self.M): +                self.cum[i + 1][j + 1] = ( +                    self.cum[i][j + 1] +                    + self.cum[i + 1][j] +                    - self.cum[i][j] +                    + data[i][j] +                ) + +    def get(self, x1, y1, x2, y2): +        """ +        長方形の領域 [x1,x2)*[y1,y2) の範囲内にインプットされた数字の和を取る +        """ +        return self.cum[x2][y2] - self.cum[x1][y2] - self.cum[x2][y1] + self.cum[x1][y1] + + -    return (min2(cnt1, 18), min2(cnt2, 18)) +    return (min(cnt1, 18), min(cnt2, 18)) -def min2(x, y): -    return x if x < y else y +def digit_lift(S, l): +    if "." in S: +        a, b = S.split(".") +        n = int(a + b) * 10 ** (l - len(b)) +    else: +        n = int(S) * 10**l +    return n -import sys - -input = sys.stdin.readline +data = [[0] * 19 for _ in range(19)] -F = [] -for i in range(N): -    A = input().rstrip() -    if "." in A: -        a, b = A.split(".") -        n = int(a + b) * 10 ** (9 - len(b)) -    else: -        n = int(A) * 10**9 -    F.append(five(n)) -F.sort() -j = 0 -temp = 0 -dp = [0] * 19 -k = 0 -for i in range(N - 1): -    if N - 1 - j < i: -        dp[min2(F[i][1], 18)] -= 1 -    while N - 1 - j > i and F[i][0] + F[N - 1 - j][0] >= 18: -        dp[min2(F[N - 1 - j][1], 18)] += 1 -        j += 1 -    k = sum(dp[: 18 - F[i][1]]) -    temp += min2(j, N - i - 1) - k -print(temp) +Q = set() +for _ in range(N): +    A = digit_lift(input().rstrip(), 9) +    x, y = five(A) +    data[x][y] += 1 +    Q.add((x, y)) +cum = cumsum2D(data) +res = 0 +for x, y in Q: +    res += (cum.get(18 - x, 18 - y, -1, -1) - (x >= 9 and y >= 9)) * data[x][y] +print((res // 2))