def intchk(n)
  return n==n.floor
end

  N = gets.to_i
  a = Array.new(N)

  ans = 0
  for i in 0..N-1 do
    a[i] = gets.to_r
    for j in 0..i-1 do
      if intchk(a[j]*a[i])
        ans += 1
      end
    end
  end

  puts ans