n = gets.to_i

nums = []
n.times do
  f = gets.to_f
  nums << (f * 1000000000).to_i # 2^9 * 5^9
end 
 
candidates = Hash.new(0)
nums.each do |num|
  i2 = 0
  while num >= 2
    break if num % 2 != 0
    i2 += 1
    num /= 2
  end

  i5 = 0
  while num >= 5
    break if 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
      if i == j
        res += candidates[keys[i]] * (candidates[keys[i]] - 1) / 2
      else
        res += candidates[keys[i]] * candidates[keys[j]]
      end
    end
    j += 1
  end
  i += 1
end
puts res
