local mmi, mma = math.min, math.max
local bls, brs = bit.lshift, bit.rshift
local mfl, mce = math.floor, math.ceil

local function getgcd(x, y)
  while 0 < x do
    x, y = y % x, x
  end
  return y
end

local t2, t5 = {}, {}
local t2min, t2max, t5min, t5max = 0, 0, 0, 0

local n = io.read("*n", "*l")
for i = 1, n do
  local s = io.read()
  local c2, c5 = 0, 0
  if s:find("%.") then
    local x, y = s:match("(%d+)%.(%d+)")
    x = tonumber(x)
    local dig = #y
    local denom = 1
    for j = 1, #y do
      denom = denom * 10
    end
    y = tonumber(y)
    local gcd = getgcd(denom, y)
    denom = mfl(denom / gcd)
    y = mfl(y / gcd)
    local a = x * denom + y
    local b = denom

    while a % 2 == 0 do
      a = mfl(a / 2)
      c2 = c2 + 1
    end
    while a % 5 == 0 do
      a = mfl(a / 5)
      c5 = c5 + 1
    end
    while b % 2 == 0 do
      b = mfl(b / 2)
      c2 = c2 - 1
    end
    while b % 5 == 0 do
      b = mfl(b / 5)
      c5 = c5 - 1
    end
  else
    local x = tonumber(s)
    while x % 2 == 0 do
      x = mfl(x / 2)
      c2 = c2 + 1
    end
    while x % 5 == 0 do
      x = mfl(x / 5)
      c5 = c5 + 1
    end
  end
  t2[i] = c2
  t5[i] = c5
  t2min = mmi(t2min, c2)
  t2max = mma(t2max, c2)
  t5min = mmi(t5min, c5)
  t5max = mma(t5max, c5)
end
local t = {}
local wid2 = t2max - t2min + 1
local wid5 = t5max - t5min + 1
local sz = wid2 * wid5
for i = 1, sz do
  t[i] = 0
end
local ret = 0
for i = 1, n do
  local c2, c5 = t2[i], t5[i]
  local need2, need5 = mma(t2min, -c2), mma(t5min, -c5)
  for j = need2, t2max do
    for k = need5, t5max do
      local idx = (j - t2min) * wid5 + (k - t5min + 1)
      ret = ret + t[idx]
    end
  end
  do
    local idx = (c2 - t2min) * wid5 + (c5 - t5min + 1)
    t[idx] = t[idx] + 1
  end
end
print(ret)
