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 = {}
(0..13).each do |k2|
  (0..5).each do |k5|
    k = (2 ** k2) * (5 ** k5)
    next if k == 1 || k >= 10000
    candidates[k] = 0
  end
end

ints.each do |i|
  candidates.each do |k, v|
    next unless i % k == 0
    candidates[k] = v + 1
  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]
      break
    end
  end
end

puts res
