# -*- coding: utf-8 -*-

import numpy as np



N = int(eval(input()))

A = [eval(input()) for _ in range(N)]



def count(a):

  if '.' in a:

    c = a.split('.')

    n = int(c[0]+c[1])

    count2 = 9 - len(c[1])

    count5 = 9 - len(c[1])

  else:

    n = int(a)

    count2 = 9

    count5 = 9

  while n%2 == 0 and count2<18:

    n //= 2

    count2 += 1

  while n%5 == 0 and count5<18:

    n //= 5

    count5 += 1

  return count2,count5



Z = np.zeros((19,19), dtype=np.int64)

answer = 0

for a in A:

  c2,c5 = count(a)

  answer += Z[18-c2,18-c5]

  Z[:c2+1,:c5+1] += 1



print(answer)
# -*- coding: utf-8 -*-

import numpy as np



N = int(eval(input()))

A = [eval(input()) for _ in range(N)]



def count(a):

  if '.' in a:

    c = a.split('.')

    n = int(c[0]+c[1])

    count2 = count5 = 9 - len(c[1])

  else:

    n = int(a)

    count2 = count5 = 9

  while n%2 == 0 and count2<18:

    n //= 2

    count2 += 1

  while n%5 == 0 and count5<18:

    n //= 5

    count5 += 1

  return count2,count5



Z = np.zeros((19,19), dtype=np.int64)

answer = 0

for a in A:

  c2,c5 = count(a)

  answer += Z[18-c2,18-c5]

  Z[:c2+1,:c5+1] += 1



print(answer)
# -*- coding: utf-8 -*-
import numpy as np

N = int(eval(input()))
A = [eval(input()) for _ in range(N)]


def count(a):
    if "." in a:
        c = a.split(".")
        n = int(c[0] + c[1])
        count2 = 9 - len(c[1])
        count5 = 9 - len(c[1])
    else:
        n = int(a)
        count2 = 9
        count5 = 9
    while n % 2 == 0 and count2 < 18:
        n //= 2
        count2 += 1
    while n % 5 == 0 and count5 < 18:
        n //= 5
        count5 += 1
    return count2, count5


Z = np.zeros((19, 19), dtype=np.int64)
answer = 0
for a in A:
    c2, c5 = count(a)
    answer += Z[18 - c2, 18 - c5]
    Z[: c2 + 1, : c5 + 1] += 1
print(answer)

# -*- coding: utf-8 -*-
import numpy as np

N = int(eval(input()))
A = [eval(input()) for _ in range(N)]


def count(a):
    if "." in a:
        c = a.split(".")
        n = int(c[0] + c[1])
        count2 = count5 = 9 - len(c[1])
    else:
        n = int(a)
        count2 = count5 = 9
    while n % 2 == 0 and count2 < 18:
        n //= 2
        count2 += 1
    while n % 5 == 0 and count5 < 18:
        n //= 5
        count5 += 1
    return count2, count5


Z = np.zeros((19, 19), dtype=np.int64)
answer = 0
for a in A:
    c2, c5 = count(a)
    answer += Z[18 - c2, 18 - c5]
    Z[: c2 + 1, : c5 + 1] += 1
print(answer)

-        count2 = 9 - len(c[1]) -        count5 = 9 - len(c[1]) +        count2 = count5 = 9 - len(c[1]) -        count2 = 9 -        count5 = 9 +        count2 = count5 = 9