n = gets.chomp.to_i
a = []
count = 0

(0...n).each{|i|
a[i] = gets.chomp.to_f.rationalize
}

for i in 0...n do
  for j in 0...(n - i - 1) do
    x = a[i] * a[i + j + 1]
    if(x - x.to_i == 0)
      count += 1
    end
  end
end

puts count
