n = gets.to_i

ints = []
floats = []
n.times do
  f = gets.to_f
  i = f.to_i
  if i == f
    ints << i
  else
    floats << (f * 1000000000).to_i
  end
end

# ints の組み合わせ全て
res = 0
if ints.size > 1
  res += ints.size * (ints.size - 1) / 2
end


candidates = Hash.new(0)
ints.each do |i|
  13.downto(0) do |k2|
    5.downto(0) do |k5|
      k = (2 ** k2) * (5 ** k5)
      next if k == 1 || k >= 10000
      next unless i % k == 0
      candidates[[k2, k5, k]] ||= Hash.new(0)
      candidates[[k2, k5, k]] += 1
    end
  end
end

# ints と floats を1つずつ選んだ際に整数になる組み合わせ
keys2 = candidates.to_a.sort
floats.each do |f|
  min5 = 10000000
  candidates.each do |(k2, k5, k), n|
    next unless k5 < min5
    m = f * k
    if m % 1000000000 == 0
      res += n
      min5 = k5
    end
  end
end

puts res
