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(round(float(eval(input()))*10**9))

    p,q = waru(a,2)-9-50,waru(a,5)-9-50

    num[p][q] += 1

    lis[i] = [p,q]

  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):

    p,q = lis[i]

    x,y = p+50,q+50

    p = -x-50

    q = -y-50

    ans += cum2[p][q]

    if x>=0 and y>=0:

      ans -= 1

  return ans//2

print((solve()))
import sys

input = sys.stdin.readline

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(round(float(eval(input()))*10**9))

    p,q = waru(a,2)-9-50,waru(a,5)-9-50

    num[p][q] += 1

    lis[i] = [p,q]

  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):

    p,q = lis[i]

    x,y = p+50,q+50

    p = -x-50

    q = -y-50

    ans += cum2[p][q]

    if x>=0 and y>=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(round(float(eval(input())) * 10**9))
        p, q = waru(a, 2) - 9 - 50, waru(a, 5) - 9 - 50
        num[p][q] += 1
        lis[i] = [p, q]
    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):
        p, q = lis[i]
        x, y = p + 50, q + 50
        p = -x - 50
        q = -y - 50
        ans += cum2[p][q]
        if x >= 0 and y >= 0:
            ans -= 1
    return ans // 2


print((solve()))

import sys

input = sys.stdin.readline


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(round(float(eval(input())) * 10**9))
        p, q = waru(a, 2) - 9 - 50, waru(a, 5) - 9 - 50
        num[p][q] += 1
        lis[i] = [p, q]
    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):
        p, q = lis[i]
        x, y = p + 50, q + 50
        p = -x - 50
        q = -y - 50
        ans += cum2[p][q]
        if x >= 0 and y >= 0:
            ans -= 1
    return ans // 2


print((solve()))

-from decimal import Decimal +import sys + +input = sys.stdin.readline