n = gets.to_i
 
nums = []
n.times do
  f = gets.to_f
  nums << (f * 1e9).round # 2^9 * 5^9
end 
 
candidates = Hash.new(0)
nums.each do |num|
  raise if num == 0

  i2 = 0
  while num % 2 == 0
    i2 += 1
    num /= 2
  end

  i5 = 0
  while num % 5 == 0
    i5 += 1
    num /= 5
  end

  candidates[[i2, i5]] += 1
end 

res = 0
keys = candidates.keys
i = 0
while i < keys.size
  j = i
  i2_0, i5_0 = keys[i]
  while j < keys.size
    i2_1, i5_1 = keys[j]
    i2 = i2_0 + i2_1
    i5 = i5_0 + i5_1
    if i2 >= 18 && i5 >= 18
      vi = candidates[keys[i]]
      vj = candidates[keys[j]]
      raise unless vi > 0 && vj > 0
      if i == j
        res += vi * (vi - 1) / 2
      else
        res += vi * vj
      end
    end
    j += 1
  end
  i += 1
end
puts res
