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))



N = int(eval(input()))



F = []

for i in range(N):

    A = float(eval(input()))

    A = round(A*(10**9))

    F.append(five(A))



F.sort()

# print(F)

j = 0

temp = 0

dp = [0]*19

k = 0

for i in range(N-1):

    if N-1-j < i:

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

        # print(i, N - j - 1, dp)

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

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

        # print(i, N - j - 1, dp)

        j += 1

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

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

    # print(j, N-i-1, k, temp)



print(temp)



"""

5

1

1

1

1

1

"""
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 = float(eval(input()))

    A = round(A*(10**9))

    F.append(five(A))



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)

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))


N = int(eval(input()))
F = []
for i in range(N):
    A = float(eval(input()))
    A = round(A * (10**9))
    F.append(five(A))
F.sort()
# print(F)
j = 0
temp = 0
dp = [0] * 19
k = 0
for i in range(N - 1):
    if N - 1 - j < i:
        dp[min(F[i][1], 18)] -= 1
        # print(i, N - j - 1, dp)
    while N - 1 - j > i and F[i][0] + F[N - 1 - j][0] >= 18:
        dp[min(F[N - 1 - j][1], 18)] += 1
        # print(i, N - j - 1, dp)
        j += 1
    k = sum(dp[: 18 - F[i][1]])
    temp += min(j, N - i - 1) - k
    # print(j, N-i-1, k, temp)
print(temp)
"""
5
1
1
1
1
1
"""

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 = float(eval(input()))
    A = round(A * (10**9))
    F.append(five(A))
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)

-    return (min(cnt1, 18), min(cnt2, 18)) +    return (min2(cnt1, 18), min2(cnt2, 18)) +def min2(x, y): +    return x if x < y else y + + +import sys + +input = sys.stdin.readline -# print(F) -        dp[min(F[i][1], 18)] -= 1 -        # print(i, N - j - 1, dp) +        dp[min2(F[i][1], 18)] -= 1 -        dp[min(F[N - 1 - j][1], 18)] += 1 -        # print(i, N - j - 1, dp) +        dp[min2(F[N - 1 - j][1], 18)] += 1 -    temp += min(j, N - i - 1) - k -    # print(j, N-i-1, k, temp) +    temp += min2(j, N - i - 1) - k -""" -5 -1 -1 -1 -1 -1 -"""