import sys

import math

import collections

import bisect

import itertools

import decimal



# import numpy as np



sys.setrecursionlimit(10 ** 7)

INF = 10 ** 20

# MOD = 10 ** 9 + 7

MOD = 998244353



ni = lambda: int(sys.stdin.readline().rstrip())

ns = lambda: list(map(int, sys.stdin.readline().rstrip().split()))

na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))

na1 = lambda: list([int(x) - 1 for x in sys.stdin.readline().rstrip().split()])





# ===CODE===

def prime_factorize(n):

    two = 0

    five = 0

    while n % 2 == 0:

        two += 1

        n //= 2



    while n % 5 == 0:

        five += 1

        n //= 5



    return two, five





def main():

    n = ni()

    a = [int(decimal.Decimal(eval(input())) * (10 ** 9)) for _ in range(n)]

    res = {}

    border = 18



    twoflg = False

    fiveflg = False

    for ai in a:

        two, five = prime_factorize(ai)



        if two >= 9:

            twoflg = True

        if five >= 9:

            fiveflg = True



        if (two, five) not in list(res.keys()):

            res[(two, five)] = 1

        else:

            res[(two, five)] += 1



    ans = 0

    if twoflg and fiveflg:

        for k, v in list(res.items()):

            two, five = k

            for tk, tv in list(res.items()):

                t_two, t_five = tk

                if two + t_two >= border and five + t_five >= border:

                    if two == t_two and five == t_five:

                        ans += v * (tv - 1)

                    else:

                        ans += v * tv



    print((ans // 2))





if __name__ == '__main__':

    main()

import sys

import math

import collections

import bisect

import itertools

import decimal



# import numpy as np



sys.setrecursionlimit(10 ** 7)

INF = 10 ** 20

# MOD = 10 ** 9 + 7

MOD = 998244353



ni = lambda: int(sys.stdin.readline().rstrip())

ns = lambda: list(map(int, sys.stdin.readline().rstrip().split()))

na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))

na1 = lambda: list([int(x) - 1 for x in sys.stdin.readline().rstrip().split()])





# ===CODE===

def prime_factorize(n):

    two = 0

    five = 0

    while n % 2 == 0:

        two += 1

        n //= 2



    while n % 5 == 0:

        five += 1

        n //= 5



    return two, five





def main():

    n = ni()

    a = [int(decimal.Decimal(sys.stdin.readline().rstrip()) * (10 ** 9)) for _ in range(n)]

    res = {}

    border = 18



    twoflg = False

    fiveflg = False

    for ai in a:

        two, five = prime_factorize(ai)



        if two >= 9:

            twoflg = True

        if five >= 9:

            fiveflg = True



        if (two, five) not in list(res.keys()):

            res[(two, five)] = 1

        else:

            res[(two, five)] += 1



    ans = 0

    if twoflg and fiveflg:

        for k, v in list(res.items()):

            two, five = k

            for tk, tv in list(res.items()):

                t_two, t_five = tk

                if two + t_two >= border and five + t_five >= border:

                    if two == t_two and five == t_five:

                        ans += v * (tv - 1)

                    else:

                        ans += v * tv



    print((ans // 2))





if __name__ == '__main__':

    main()

import sys
import math
import collections
import bisect
import itertools
import decimal

# import numpy as np
sys.setrecursionlimit(10**7)
INF = 10**20
# MOD = 10 ** 9 + 7
MOD = 998244353
ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list([int(x) - 1 for x in sys.stdin.readline().rstrip().split()])
# ===CODE===
def prime_factorize(n):
    two = 0
    five = 0
    while n % 2 == 0:
        two += 1
        n //= 2
    while n % 5 == 0:
        five += 1
        n //= 5
    return two, five


def main():
    n = ni()
    a = [int(decimal.Decimal(eval(input())) * (10**9)) for _ in range(n)]
    res = {}
    border = 18
    twoflg = False
    fiveflg = False
    for ai in a:
        two, five = prime_factorize(ai)
        if two >= 9:
            twoflg = True
        if five >= 9:
            fiveflg = True
        if (two, five) not in list(res.keys()):
            res[(two, five)] = 1
        else:
            res[(two, five)] += 1
    ans = 0
    if twoflg and fiveflg:
        for k, v in list(res.items()):
            two, five = k
            for tk, tv in list(res.items()):
                t_two, t_five = tk
                if two + t_two >= border and five + t_five >= border:
                    if two == t_two and five == t_five:
                        ans += v * (tv - 1)
                    else:
                        ans += v * tv
    print((ans // 2))


if __name__ == "__main__":
    main()

import sys
import math
import collections
import bisect
import itertools
import decimal

# import numpy as np
sys.setrecursionlimit(10**7)
INF = 10**20
# MOD = 10 ** 9 + 7
MOD = 998244353
ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list([int(x) - 1 for x in sys.stdin.readline().rstrip().split()])
# ===CODE===
def prime_factorize(n):
    two = 0
    five = 0
    while n % 2 == 0:
        two += 1
        n //= 2
    while n % 5 == 0:
        five += 1
        n //= 5
    return two, five


def main():
    n = ni()
    a = [
        int(decimal.Decimal(sys.stdin.readline().rstrip()) * (10**9))
        for _ in range(n)
    ]
    res = {}
    border = 18
    twoflg = False
    fiveflg = False
    for ai in a:
        two, five = prime_factorize(ai)
        if two >= 9:
            twoflg = True
        if five >= 9:
            fiveflg = True
        if (two, five) not in list(res.keys()):
            res[(two, five)] = 1
        else:
            res[(two, five)] += 1
    ans = 0
    if twoflg and fiveflg:
        for k, v in list(res.items()):
            two, five = k
            for tk, tv in list(res.items()):
                t_two, t_five = tk
                if two + t_two >= border and five + t_five >= border:
                    if two == t_two and five == t_five:
                        ans += v * (tv - 1)
                    else:
                        ans += v * tv
    print((ans // 2))


if __name__ == "__main__":
    main()

-    a = [int(decimal.Decimal(eval(input())) * (10**9)) for _ in range(n)] +    a = [ +        int(decimal.Decimal(sys.stdin.readline().rstrip()) * (10**9)) +        for _ in range(n) +    ]