import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7

MAX = 50





def resolve():

    n = int(eval(input()))



    D = [[0] * MAX for _ in range(MAX)]

    for _ in range(n):

        a = int(round(float(eval(input())) * 10 ** 9))

        t = a

        x = 0

        while t % 2 == 0:

            t //= 2

            x += 1

        t = a

        y = 0

        while t % 5 == 0:

            t //= 5

            y += 1

        D[x][y] += 1



    res = 0

    for x1 in range(MAX):

        for y1 in range(MAX):

            for x2 in range(max(0, 18 - x1), MAX):

                for y2 in range(max(0, 18 - y1), MAX):

                    if x1 == x2 and y1 == y2:

                        res += D[x1][y1] * (D[x1][y1] - 1)

                    else:

                        res += D[x1][y1] * D[x2][y2]

    print((res // 2))





if __name__ == '__main__':

    resolve()

import sys



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 998244353





def resolve():

    n = int(eval(input()))

    A = []

    for _ in range(n):

        a = float(eval(input()))

        a = round(a * 10 ** 9 + 0.1)

        A.append(a)



    L = [[0] * 25 for _ in range(45)]

    D = []

    for a in A:

        tmp = a

        ex2 = ex5 = 0

        while tmp % 2 == 0:

            tmp //= 2

            ex2 += 1

        tmp = a

        while tmp % 5 == 0:

            tmp //= 5

            ex5 += 1

        L[ex2][ex5] += 1

        D.append((ex2, ex5))



    res = 0

    check = [[False] * 25 for _ in range(45)]

    for i in range(45):

        for j in range(25):

            if L[i][j] == 0:

                check[i][j] = True

                continue

            for k in range(18 - i, 45):

                for l in range(18 - j, 25):

                    if check[k][l]:

                        continue

                    if k == i and l == j:

                        res += L[i][j] * (L[k][l] - 1) // 2

                    else:

                        res += L[i][j] * L[k][l]

            check[i][j] = True

    print(res)





if __name__ == '__main__':

    resolve()

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7
MAX = 50


def resolve():
    n = int(eval(input()))
    D = [[0] * MAX for _ in range(MAX)]
    for _ in range(n):
        a = int(round(float(eval(input())) * 10**9))
        t = a
        x = 0
        while t % 2 == 0:
            t //= 2
            x += 1
        t = a
        y = 0
        while t % 5 == 0:
            t //= 5
            y += 1
        D[x][y] += 1
    res = 0
    for x1 in range(MAX):
        for y1 in range(MAX):
            for x2 in range(max(0, 18 - x1), MAX):
                for y2 in range(max(0, 18 - y1), MAX):
                    if x1 == x2 and y1 == y2:
                        res += D[x1][y1] * (D[x1][y1] - 1)
                    else:
                        res += D[x1][y1] * D[x2][y2]
    print((res // 2))


if __name__ == "__main__":
    resolve()

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 998244353


def resolve():
    n = int(eval(input()))
    A = []
    for _ in range(n):
        a = float(eval(input()))
        a = round(a * 10**9 + 0.1)
        A.append(a)
    L = [[0] * 25 for _ in range(45)]
    D = []
    for a in A:
        tmp = a
        ex2 = ex5 = 0
        while tmp % 2 == 0:
            tmp //= 2
            ex2 += 1
        tmp = a
        while tmp % 5 == 0:
            tmp //= 5
            ex5 += 1
        L[ex2][ex5] += 1
        D.append((ex2, ex5))
    res = 0
    check = [[False] * 25 for _ in range(45)]
    for i in range(45):
        for j in range(25):
            if L[i][j] == 0:
                check[i][j] = True
                continue
            for k in range(18 - i, 45):
                for l in range(18 - j, 25):
                    if check[k][l]:
                        continue
                    if k == i and l == j:
                        res += L[i][j] * (L[k][l] - 1) // 2
                    else:
                        res += L[i][j] * L[k][l]
            check[i][j] = True
    print(res)


if __name__ == "__main__":
    resolve()

-mod = 10**9 + 7 -MAX = 50 +mod = 998244353 -    D = [[0] * MAX for _ in range(MAX)] +    A = [] -        a = int(round(float(eval(input())) * 10**9)) -        t = a -        x = 0 -        while t % 2 == 0: -            t //= 2 -            x += 1 -        t = a -        y = 0 -        while t % 5 == 0: -            t //= 5 -            y += 1 -        D[x][y] += 1 +        a = float(eval(input())) +        a = round(a * 10**9 + 0.1) +        A.append(a) +    L = [[0] * 25 for _ in range(45)] +    D = [] +    for a in A: +        tmp = a +        ex2 = ex5 = 0 +        while tmp % 2 == 0: +            tmp //= 2 +            ex2 += 1 +        tmp = a +        while tmp % 5 == 0: +            tmp //= 5 +            ex5 += 1 +        L[ex2][ex5] += 1 +        D.append((ex2, ex5)) -    for x1 in range(MAX): -        for y1 in range(MAX): -            for x2 in range(max(0, 18 - x1), MAX): -                for y2 in range(max(0, 18 - y1), MAX): -                    if x1 == x2 and y1 == y2: -                        res += D[x1][y1] * (D[x1][y1] - 1) +    check = [[False] * 25 for _ in range(45)] +    for i in range(45): +        for j in range(25): +            if L[i][j] == 0: +                check[i][j] = True +                continue +            for k in range(18 - i, 45): +                for l in range(18 - j, 25): +                    if check[k][l]: +                        continue +                    if k == i and l == j: +                        res += L[i][j] * (L[k][l] - 1) // 2 -                        res += D[x1][y1] * D[x2][y2] -    print((res // 2)) +                        res += L[i][j] * L[k][l] +            check[i][j] = True +    print(res)