def divide(n, p):

    c = 0

    while n%p == 0 and c < 18:

        c += 1

        n //= p

    return c



n = int(eval(input()))

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

for i in range(n):

    sub = eval(input())

    key = float(sub)

    if "." in sub:

        a, b = list(map(str, sub.split(".")))

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

    else:

        s = int(sub)

        s *= 1000000000

    if key != s/1000000000:

        while True:

            pass

    c2, c5 = divide(s, 2), divide(s, 5)

    table[c2][c5] += 1



ans = 0

for i in range(19):

    for j in range(19):

        for k in range(19):

            for l in range(19):

                if i+k < 18 or j+l < 18:

                    continue;

                if i == k and j == l:

                    ans += table[i][j]*(table[k][l]-1)

                else:

                    ans += table[i][j]*table[k][l]



ans //= 2

print(ans)
import sys

input = sys.stdin.readline





def divide(n):

    c1, c2 = 0, 0

    while (n%2 == 0):

        c1 += 1

        n //= 2

    while (n%5 == 0):

        c2 += 1

        n //= 5

    return (c1, c2)

    



def main():

    n = int(eval(input()))

    a = [None]*n

    for i in range(n):

        sub = input().replace("\n", "")

        if "." in sub:

            x, y = list(map(str, sub.split(".")))

            s = int(x)*1000000000+10**(9-len(y))*int(y)

        else:

            s = int(sub)

            s *= 1000000000

        a[i] = divide(s)



    dp = [[0]*100 for _ in range(100)]

    for i in range(n):

        c1, c2 = a[i]

        dp[c1][c2] += 1

    

    for i in range(98, -1, -1):

        for j in range(98, -1, -1):

            dp[i][j] += dp[i+1][j]+dp[i][j+1]-dp[i+1][j+1]



    ans = 0

    for i in range(n):

        c1, c2 = a[i]

        if (c1 >= 9 and c2 >= 9):

            ans -= 1

        if c1 >= 18 and c2 >= 18:

            ans += dp[0][0]

            continue

        if c1 >= 18:

            ans += dp[0][18-c2]

            continue

        if c2 >= 18:

            ans += dp[18-c1][0]

            continue

        ans += dp[18-c1][18-c2]

        

    print((ans//2))

    

    

    

if __name__ == "__main__":

    main()

def divide(n, p):
    c = 0
    while n % p == 0 and c < 18:
        c += 1
        n //= p
    return c


n = int(eval(input()))
table = [[0] * 19 for _ in range(19)]
for i in range(n):
    sub = eval(input())
    key = float(sub)
    if "." in sub:
        a, b = list(map(str, sub.split(".")))
        s = int(a) * 1000000000 + 10 ** (9 - len(b)) * int(b)
    else:
        s = int(sub)
        s *= 1000000000
    if key != s / 1000000000:
        while True:
            pass
    c2, c5 = divide(s, 2), divide(s, 5)
    table[c2][c5] += 1
ans = 0
for i in range(19):
    for j in range(19):
        for k in range(19):
            for l in range(19):
                if i + k < 18 or j + l < 18:
                    continue
                if i == k and j == l:
                    ans += table[i][j] * (table[k][l] - 1)
                else:
                    ans += table[i][j] * table[k][l]
ans //= 2
print(ans)

import sys

input = sys.stdin.readline


def divide(n):
    c1, c2 = 0, 0
    while n % 2 == 0:
        c1 += 1
        n //= 2
    while n % 5 == 0:
        c2 += 1
        n //= 5
    return (c1, c2)


def main():
    n = int(eval(input()))
    a = [None] * n
    for i in range(n):
        sub = input().replace("\n", "")
        if "." in sub:
            x, y = list(map(str, sub.split(".")))
            s = int(x) * 1000000000 + 10 ** (9 - len(y)) * int(y)
        else:
            s = int(sub)
            s *= 1000000000
        a[i] = divide(s)
    dp = [[0] * 100 for _ in range(100)]
    for i in range(n):
        c1, c2 = a[i]
        dp[c1][c2] += 1
    for i in range(98, -1, -1):
        for j in range(98, -1, -1):
            dp[i][j] += dp[i + 1][j] + dp[i][j + 1] - dp[i + 1][j + 1]
    ans = 0
    for i in range(n):
        c1, c2 = a[i]
        if c1 >= 9 and c2 >= 9:
            ans -= 1
        if c1 >= 18 and c2 >= 18:
            ans += dp[0][0]
            continue
        if c1 >= 18:
            ans += dp[0][18 - c2]
            continue
        if c2 >= 18:
            ans += dp[18 - c1][0]
            continue
        ans += dp[18 - c1][18 - c2]
    print((ans // 2))


if __name__ == "__main__":
    main()

-def divide(n, p): -    c = 0 -    while n % p == 0 and c < 18: -        c += 1 -        n //= p -    return c +import sys + +input = sys.stdin.readline -n = int(eval(input())) -table = [[0] * 19 for _ in range(19)] -for i in range(n): -    sub = eval(input()) -    key = float(sub) -    if "." in sub: -        a, b = list(map(str, sub.split("."))) -        s = int(a) * 1000000000 + 10 ** (9 - len(b)) * int(b) -    else: -        s = int(sub) -        s *= 1000000000 -    if key != s / 1000000000: -        while True: -            pass -    c2, c5 = divide(s, 2), divide(s, 5) -    table[c2][c5] += 1 -ans = 0 -for i in range(19): -    for j in range(19): -        for k in range(19): -            for l in range(19): -                if i + k < 18 or j + l < 18: -                    continue -                if i == k and j == l: -                    ans += table[i][j] * (table[k][l] - 1) -                else: -                    ans += table[i][j] * table[k][l] -ans //= 2 -print(ans) +def divide(n): +    c1, c2 = 0, 0 +    while n % 2 == 0: +        c1 += 1 +        n //= 2 +    while n % 5 == 0: +        c2 += 1 +        n //= 5 +    return (c1, c2) + + +def main(): +    n = int(eval(input())) +    a = [None] * n +    for i in range(n): +        sub = input().replace("\n", "") +        if "." in sub: +            x, y = list(map(str, sub.split("."))) +            s = int(x) * 1000000000 + 10 ** (9 - len(y)) * int(y) +        else: +            s = int(sub) +            s *= 1000000000 +        a[i] = divide(s) +    dp = [[0] * 100 for _ in range(100)] +    for i in range(n): +        c1, c2 = a[i] +        dp[c1][c2] += 1 +    for i in range(98, -1, -1): +        for j in range(98, -1, -1): +            dp[i][j] += dp[i + 1][j] + dp[i][j + 1] - dp[i + 1][j + 1] +    ans = 0 +    for i in range(n): +        c1, c2 = a[i] +        if c1 >= 9 and c2 >= 9: +            ans -= 1 +        if c1 >= 18 and c2 >= 18: +            ans += dp[0][0] +            continue +        if c1 >= 18: +            ans += dp[0][18 - c2] +            continue +        if c2 >= 18: +            ans += dp[18 - c1][0] +            continue +        ans += dp[18 - c1][18 - c2] +    print((ans // 2)) + + +if __name__ == "__main__": +    main()