require 'prime'

class Array
  def imos
    n = size

    ret = map(&:dup)

    (n - 1).downto(0) do |i|
      (n - 2).downto(0) do |j|
        ret[i][j] += ret[i][j + 1]
      end
    end

    (n - 2).downto(0) do |i|
      (n - 1).downto(0) do |j|
        ret[i][j] += ret[i + 1][j]
      end
    end

    ret
  end
end

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

table = Array.new(19) { Array.new(19, 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
end

table = table.imos
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

  ni = 18 - cnt_2
  nj = 18 - cnt_5

  if 9 <= cnt_2 && 9 <= cnt_5
    ans -= 1
  end

  ans += table[ni][nj]
end

puts ans / 2
