import sys

input = sys.stdin.readline



class BIT2D:

    def __init__(self, H, W):

        self.H = H

        self.W = W

        self.data = [[0] * (H+1) for _ in range(W+1)]



    def add(self, a, b, x):

        a += 1

        b += 1

        i = a

        while i <= self.H:

            j = b

            while j <= self.W:

                self.data[i][j] += x

                j += j & -j

            i += i & -i



    def sum(self, a, b):

        a += 1

        b += 1

        ret = 0

        i = a

        while i > 0:

            j = b

            while j > 0:

                ret += self.data[i][j]

                j -= j & -j

            i -= i & -i

        return ret



N = int(eval(input()))

A = []

for _ in range(N):

    n = input().rstrip()

    if '.' not in n:

        A.append(int(n) * 10**9)

    else:

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

        b += '0' * (9 - len(b))

        A.append(int(a + b))

ans = 0

bit = BIT2D(100, 100)

for i in range(N):

    cnt2 = cnt5 = 0

    while A[i] % 2 == 0:

        A[i] //= 2

        cnt2 += 1

    while A[i] % 5 == 0:

        A[i] //= 5

        cnt5 += 1

    if cnt2 >= 18 and cnt5 >= 18:

        ans += i

    else:

        ans += i - bit.sum(99, 17 - cnt5) - bit.sum(17 - cnt2, 99) + bit.sum(17 - cnt2, 17 - cnt5)

    bit.add(cnt2, cnt5, 1)

print(ans)

from collections import defaultdict

import sys

input = sys.stdin.readline



N = int(eval(input()))

A = []

for _ in range(N):

    n = input().rstrip()

    if '.' not in n:

        A.append(int(n) * 10**9)

    else:

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

        b += '0' * (9 - len(b))

        A.append(int(a + b))

cnt = defaultdict(int)

ans = 0

for i in range(N):

    cnt2 = cnt5 = 0

    while A[i] % 2 == 0:

        A[i] //= 2

        cnt2 += 1

    while A[i] % 5 == 0:

        A[i] //= 5

        cnt5 += 1

    cnt[(cnt2, cnt5)] += 1

for p1, c1 in list(cnt.items()):

    for p2, c2 in list(cnt.items()):

        if p1 > p2:

            continue

        if p1[0] + p2[0] >= 18 and p1[1] + p2[1] >= 18:

            if p1 == p2:

                ans += c1 * (c1 - 1) // 2

            else:

                ans += c1 * c2

print(ans)

import sys

input = sys.stdin.readline


class BIT2D:
    def __init__(self, H, W):
        self.H = H
        self.W = W
        self.data = [[0] * (H + 1) for _ in range(W + 1)]

    def add(self, a, b, x):
        a += 1
        b += 1
        i = a
        while i <= self.H:
            j = b
            while j <= self.W:
                self.data[i][j] += x
                j += j & -j
            i += i & -i

    def sum(self, a, b):
        a += 1
        b += 1
        ret = 0
        i = a
        while i > 0:
            j = b
            while j > 0:
                ret += self.data[i][j]
                j -= j & -j
            i -= i & -i
        return ret


N = int(eval(input()))
A = []
for _ in range(N):
    n = input().rstrip()
    if "." not in n:
        A.append(int(n) * 10**9)
    else:
        a, b = n.split(".")
        b += "0" * (9 - len(b))
        A.append(int(a + b))
ans = 0
bit = BIT2D(100, 100)
for i in range(N):
    cnt2 = cnt5 = 0
    while A[i] % 2 == 0:
        A[i] //= 2
        cnt2 += 1
    while A[i] % 5 == 0:
        A[i] //= 5
        cnt5 += 1
    if cnt2 >= 18 and cnt5 >= 18:
        ans += i
    else:
        ans += (
            i
            - bit.sum(99, 17 - cnt5)
            - bit.sum(17 - cnt2, 99)
            + bit.sum(17 - cnt2, 17 - cnt5)
        )
    bit.add(cnt2, cnt5, 1)
print(ans)

from collections import defaultdict
import sys

input = sys.stdin.readline
N = int(eval(input()))
A = []
for _ in range(N):
    n = input().rstrip()
    if "." not in n:
        A.append(int(n) * 10**9)
    else:
        a, b = n.split(".")
        b += "0" * (9 - len(b))
        A.append(int(a + b))
cnt = defaultdict(int)
ans = 0
for i in range(N):
    cnt2 = cnt5 = 0
    while A[i] % 2 == 0:
        A[i] //= 2
        cnt2 += 1
    while A[i] % 5 == 0:
        A[i] //= 5
        cnt5 += 1
    cnt[(cnt2, cnt5)] += 1
for p1, c1 in list(cnt.items()):
    for p2, c2 in list(cnt.items()):
        if p1 > p2:
            continue
        if p1[0] + p2[0] >= 18 and p1[1] + p2[1] >= 18:
            if p1 == p2:
                ans += c1 * (c1 - 1) // 2
            else:
                ans += c1 * c2
print(ans)

+from collections import defaultdict - - -class BIT2D: -    def __init__(self, H, W): -        self.H = H -        self.W = W -        self.data = [[0] * (H + 1) for _ in range(W + 1)] - -    def add(self, a, b, x): -        a += 1 -        b += 1 -        i = a -        while i <= self.H: -            j = b -            while j <= self.W: -                self.data[i][j] += x -                j += j & -j -            i += i & -i - -    def sum(self, a, b): -        a += 1 -        b += 1 -        ret = 0 -        i = a -        while i > 0: -            j = b -            while j > 0: -                ret += self.data[i][j] -                j -= j & -j -            i -= i & -i -        return ret - - +cnt = defaultdict(int) -bit = BIT2D(100, 100) -    if cnt2 >= 18 and cnt5 >= 18: -        ans += i -    else: -        ans += ( -            i -            - bit.sum(99, 17 - cnt5) -            - bit.sum(17 - cnt2, 99) -            + bit.sum(17 - cnt2, 17 - cnt5) -        ) -    bit.add(cnt2, cnt5, 1) +    cnt[(cnt2, cnt5)] += 1 +for p1, c1 in list(cnt.items()): +    for p2, c2 in list(cnt.items()): +        if p1 > p2: +            continue +        if p1[0] + p2[0] >= 18 and p1[1] + p2[1] >= 18: +            if p1 == p2: +                ans += c1 * (c1 - 1) // 2 +            else: +                ans += c1 * c2