require "prime"

class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @n = gets.to_s.to_i
    @a = Array.new(n){ 
      x, y = gets.chomp.split(".")
      y ||= ""
      y = y.ljust(9,"0")
      (x + y).to_i
    }
  end

  def rec
    # dp[2の指数][5の指数] := 個数
    @dp = Array.new(45){ Array.new(20, 0) }
    a.each do |x|
      h = Prime.prime_division(x).to_h
      m2 = h[2] || 0
      m5 = h[5] || 0
      @dp[m2][m5] += 1
    end
  end

  def solve
    rec
    ans = 0
    45.times do |i|
      20.times do |j|
        45.times do |k|
          20.times do |l|
            next if i + k < 18
            next if j + l < 18

            if i == k && j == l
              ans += @dp[i][j] * (@dp[k][l] - 1)
            else
              ans += @dp[i][j] * @dp[k][l]
            end
          end
        end
      end
    end
    ans / 2
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end