from decimal import Decimal

def waru(N,num):

  cnt = 0

  while N%num==0:

    N //= num

    cnt += 1

  return cnt

def solve():

  N = int(eval(input()))

  num = [[0]*101 for _ in range(101)]

  lis = [0]*N

  for i in range(N):

    a = int(Decimal(eval(input()))*10**9)

    two,five = waru(a,2)-9,waru(a,5)-9

    two -= 50

    five -= 50

    num[two][five] += 1

    lis[i] = [two,five]

  cum2 = [[0]*101 for _ in range(101)]

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

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

      cum2[i][j] = cum2[i+1][j]+cum2[i][j+1]-cum2[i+1][j+1]+num[i][j]

  ans = 0

  for i in range(N):

    two,five = lis[i]

    two2,five2 = -(two+50)-50,-(five+50)-50

    ans += cum2[two2][five2]

    if two+50>=0 and five+50>=0:

      ans -= 1

  return ans//2

print((solve()))
from decimal import Decimal

def waru(N,num):

  cnt = 0

  while N%num==0:

    N //= num

    cnt += 1

  return cnt

def solve():

  N = int(eval(input()))

  num = [[0]*101 for _ in range(101)]

  lis = [0]*N

  for i in range(N):

    a = eval(input())

    b = a.split(".")

    if len(b)==1:

        a = int(a)*(10**9)

    else:

        a = int(b[0] + b[1] + (9-len(b[1]))*"0")

    two,five = waru(a,2)-9,waru(a,5)-9

    two -= 50

    five -= 50

    num[two][five] += 1

    lis[i] = [two,five]

  cum2 = [[0]*101 for _ in range(101)]

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

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

      cum2[i][j] = cum2[i+1][j]+cum2[i][j+1]-cum2[i+1][j+1]+num[i][j]

  ans = 0

  for i in range(N):

    two,five = lis[i]

    two2,five2 = -(two+50)-50,-(five+50)-50

    ans += cum2[two2][five2]

    if two+50>=0 and five+50>=0:

      ans -= 1

  return ans//2

print((solve()))
from decimal import Decimal


def waru(N, num):
    cnt = 0
    while N % num == 0:
        N //= num
        cnt += 1
    return cnt


def solve():
    N = int(eval(input()))
    num = [[0] * 101 for _ in range(101)]
    lis = [0] * N
    for i in range(N):
        a = int(Decimal(eval(input())) * 10**9)
        two, five = waru(a, 2) - 9, waru(a, 5) - 9
        two -= 50
        five -= 50
        num[two][five] += 1
        lis[i] = [two, five]
    cum2 = [[0] * 101 for _ in range(101)]
    for i in range(99, -1, -1):
        for j in range(99, -1, -1):
            cum2[i][j] = (
                cum2[i + 1][j] + cum2[i][j + 1] - cum2[i + 1][j + 1] + num[i][j]
            )
    ans = 0
    for i in range(N):
        two, five = lis[i]
        two2, five2 = -(two + 50) - 50, -(five + 50) - 50
        ans += cum2[two2][five2]
        if two + 50 >= 0 and five + 50 >= 0:
            ans -= 1
    return ans // 2


print((solve()))

from decimal import Decimal


def waru(N, num):
    cnt = 0
    while N % num == 0:
        N //= num
        cnt += 1
    return cnt


def solve():
    N = int(eval(input()))
    num = [[0] * 101 for _ in range(101)]
    lis = [0] * N
    for i in range(N):
        a = eval(input())
        b = a.split(".")
        if len(b) == 1:
            a = int(a) * (10**9)
        else:
            a = int(b[0] + b[1] + (9 - len(b[1])) * "0")
        two, five = waru(a, 2) - 9, waru(a, 5) - 9
        two -= 50
        five -= 50
        num[two][five] += 1
        lis[i] = [two, five]
    cum2 = [[0] * 101 for _ in range(101)]
    for i in range(99, -1, -1):
        for j in range(99, -1, -1):
            cum2[i][j] = (
                cum2[i + 1][j] + cum2[i][j + 1] - cum2[i + 1][j + 1] + num[i][j]
            )
    ans = 0
    for i in range(N):
        two, five = lis[i]
        two2, five2 = -(two + 50) - 50, -(five + 50) - 50
        ans += cum2[two2][five2]
        if two + 50 >= 0 and five + 50 >= 0:
            ans -= 1
    return ans // 2


print((solve()))

-        a = int(Decimal(eval(input())) * 10**9) +        a = eval(input()) +        b = a.split(".") +        if len(b) == 1: +            a = int(a) * (10**9) +        else: +            a = int(b[0] + b[1] + (9 - len(b[1])) * "0")