output_description: Print the number of pairs with integer product A_i \cdot A_j (and i < j).
  
  * * *
input_description: Input is given from Standard Input in the following format.
  
      
      
      N
      A_1
      A_2
      \vdots
      A_N
attempt: # from collections import deque,defaultdict
  printn = lambda x: print(x, end="")
  inn = lambda: int(input())
  inl = lambda: list(map(int, input().split()))
  inm = lambda: map(int, input().split())
  ins = lambda: input().strip()
  DBG = True  # and False
  BIG = 10**18
  R = 10**9 + 7
  # R = 998244353
  
  
  def ddprint(x):
      if DBG:
          print(x)
  
  
  OFS = 20
  KK = 41
  n = inn()
  d = [[0] * KK for i in range(KK)]
  for i in range(n):
      a = ins()
      p = a.find(".")
      if p < 0:
          v = int(a)
          k = 0
      else:
          b = a[:p] + a[p + 1 :]
          v = int(b)
          k = len(a) - 1 - p
      x2 = 0
      while v % 2 == 0:
          x2 += 1
          v //= 2
      x2 = min(x2, OFS)
      x5 = 0
      while v % 5 == 0:
          x5 += 1
          v //= 5
      x5 = min(x5, OFS)
      d[x2 - k + OFS][x5 - k + OFS] += 1
  
  # if DBG:
  #    for i in range(KK):
  #        for j in range(KK):
  #            if d[i][j]!=0:
  #                ddprint(f"i {i-OFS} j {j-OFS} {d[i][j]}")
  
  ans = 0
  h = {}
  for p in range(KK):
      for q in range(KK):
          sm = 0 if p < OFS or q < OFS else (d[p][q] * (d[p][q] - 1) // 2)
          # if sm>0:
          # ddprint(f"p {p-OFS} q {q-OFS} d {d[p][q]} {sm=}")
          for r in range(-p + 2 * OFS, KK):
              # if r==p:
              #    continue
              for s in range(-q + 2 * OFS, KK):
                  if (r, s) == (p, q) or (r, s, p, q) in h:
                      continue
                  h[(p, q, r, s)] = 1
                  sm += d[p][q] * d[r][s]
                  # if d[p][q]*d[r][s]>0:
                  #    ddprint(f"p {p-OFS} q {q-OFS} r {r-OFS} s {s-OFS} d {d[p][q]} {d[r][s]}")
          ans += sm
  print(ans)
  
problem_description: Statement
  
  You are given N real values A_1, A_2, \ldots, A_N. Compute the number of pairs
  of indices (i, j) such that i < j and the product A_i \cdot A_j is integer.
samples: [{"input": "5\n    7.5\n    2.4\n    17.000000001\n    17\n    16.000000000", "output": "3\n    \n\nThere are 3 pairs with integer product:\n\n  * 7.5 \\cdot 2.4 = 18\n  * 7.5 \\cdot 16 = 120\n  * 17 \\cdot 16 = 272\n\n* * *"}, {"input": "11\n    0.9\n    1\n    1\n    1.25\n    2.30000\n    5\n    70\n    0.000000001\n    9999.999999999\n    0.999999999\n    1.000000001", "output": "8"}]