N = gets.to_i
A = []
N.times{
  A.push Rational(gets.chomp)
}

count = 0

0.upto(N-2){ |i|
  (i+1).upto(N-1){ |j|
    #puts A[i], A[j]
    tmp = A[i] * A[j]
    #p tmp, tmp.to_i
    if tmp == tmp.to_i
      #puts 'yes'
      count += 1
    end
    #puts
  }
}

puts count
