n = int(eval(input()))

As = [int(round(float(eval(input()))*10**9)) for _ in  range(n)]



fives = [0] * n

twos = [0] * n

cnts = [[0] * 20 for i in range(20)]

for i, a in enumerate(As):

    tmp = a

    five = 0

    two = 0

    while tmp % 5 == 0:

        five += 1

        tmp //= 5

    while tmp % 2 == 0:

        two += 1

        tmp //= 2

    cnts[min(two,18)][min(five,18)] += 1



# fiveの和とtwoの和が共に18以上ならOK

# 条件を満たすcnts        

ans = 0

for i1 in range(19):

    for j1 in range(19):

        for i2 in range(19):

            for j2 in range(19):

                if i1+i2 >= 18 and j1+j2>=18:

                    ans += cnts[i1][j1]*cnts[i2][j2]



# 自分自身を除外

for i in range(19):

    for j in range(19):

        if i*2 >= 18 and j*2 >= 18:

            ans -= cnts[i][j]



# ダブルカウント

ans //= 2

print(ans)
import sys

input = sys.stdin.readline



n = int(eval(input()))

As = [int(round(float(eval(input()))*10**9)) for _ in  range(n)]



fives = [0] * n

twos = [0] * n

cnts = [[0] * 20 for i in range(20)]

for i, a in enumerate(As):

    tmp = a

    five = 0

    two = 0

    while tmp % 5 == 0:

        five += 1

        tmp //= 5

    while tmp % 2 == 0:

        two += 1

        tmp //= 2

    cnts[min(two,18)][min(five,18)] += 1



# fiveの和とtwoの和が共に18以上ならOK

# 条件を満たすcnts        

ans = 0

for i1 in range(19):

    for j1 in range(19):

        for i2 in range(19):

            for j2 in range(19):

                if i1+i2 >= 18 and j1+j2>=18:

                    ans += cnts[i1][j1]*cnts[i2][j2]



# 自分自身を除外

for i in range(19):

    for j in range(19):

        if i*2 >= 18 and j*2 >= 18:

            ans -= cnts[i][j]



# ダブルカウント

ans //= 2

print(ans)
n = int(eval(input()))
As = [int(round(float(eval(input())) * 10**9)) for _ in range(n)]
fives = [0] * n
twos = [0] * n
cnts = [[0] * 20 for i in range(20)]
for i, a in enumerate(As):
    tmp = a
    five = 0
    two = 0
    while tmp % 5 == 0:
        five += 1
        tmp //= 5
    while tmp % 2 == 0:
        two += 1
        tmp //= 2
    cnts[min(two, 18)][min(five, 18)] += 1
# fiveの和とtwoの和が共に18以上ならOK
# 条件を満たすcnts
ans = 0
for i1 in range(19):
    for j1 in range(19):
        for i2 in range(19):
            for j2 in range(19):
                if i1 + i2 >= 18 and j1 + j2 >= 18:
                    ans += cnts[i1][j1] * cnts[i2][j2]
# 自分自身を除外
for i in range(19):
    for j in range(19):
        if i * 2 >= 18 and j * 2 >= 18:
            ans -= cnts[i][j]
# ダブルカウント
ans //= 2
print(ans)

import sys

input = sys.stdin.readline
n = int(eval(input()))
As = [int(round(float(eval(input())) * 10**9)) for _ in range(n)]
fives = [0] * n
twos = [0] * n
cnts = [[0] * 20 for i in range(20)]
for i, a in enumerate(As):
    tmp = a
    five = 0
    two = 0
    while tmp % 5 == 0:
        five += 1
        tmp //= 5
    while tmp % 2 == 0:
        two += 1
        tmp //= 2
    cnts[min(two, 18)][min(five, 18)] += 1
# fiveの和とtwoの和が共に18以上ならOK
# 条件を満たすcnts
ans = 0
for i1 in range(19):
    for j1 in range(19):
        for i2 in range(19):
            for j2 in range(19):
                if i1 + i2 >= 18 and j1 + j2 >= 18:
                    ans += cnts[i1][j1] * cnts[i2][j2]
# 自分自身を除外
for i in range(19):
    for j in range(19):
        if i * 2 >= 18 and j * 2 >= 18:
            ans -= cnts[i][j]
# ダブルカウント
ans //= 2
print(ans)

+import sys + +input = sys.stdin.readline