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|
  max5 = -1
  13.downto(0) do |k2|
    5.downto(0) do |k5|
      break if max5 >= k5
      k = (2 ** k2) * (5 ** k5)
      next if k == 1 || k >= 10000
      next unless i % k == 0
      candidates[k] += 1
      max5 = k5
      break
    end
  end
end

# ints と floats を1つずつ選んだ際に整数になる組み合わせ
keys = candidates.keys.select{|k| candidates[k] > 0 }.sort
floats.each do |f|
  keys.each do |k|
    m = f * k
    if m % 1000000000 == 0
      res += candidates[k]
    end
  end
end

puts res
