require 'prime'

M = 10 ** 9
N = gets.to_i
A = N.times.map { gets.to_f }

table = Array.new(19) { Array.new(19, 0) }
table[0][0] = 1

A.each do |a|
  primes = (a * M).to_i.prime_division.to_h

  cnt_2 = primes[2] || 0
  cnt_5 = primes[5] || 0

  cnt_2 = 18 if 18 < cnt_2
  cnt_5 = 18 if 18 < cnt_5

  table[cnt_2][cnt_5] += 1
end

ans = 0

A.each do |a|
  primes = (a * M).to_i.prime_division.to_h

  cnt_2 = primes[2] || 0
  cnt_5 = primes[5] || 0

  cnt_2 = 18 if 18 < cnt_2
  cnt_5 = 18 if 18 < cnt_5

  table[cnt_2][cnt_5] -= 1

  (18 - cnt_2).upto(18) do |c2|
    (18 - cnt_5).upto(18) do |c5|
      ans += table[c2][c5]
    end
  end

  table[cnt_2][cnt_5] += 1
end

puts ans / 2
