require 'rational'

n=gets.to_i
a=ARGF.map{|s| Rational(s)}

count=0
(0...n).each{|i|
    (i+1...n).each{|k|
        x = a[i]*a[k]
        if(x.denominator == 1)
            count+=1
        end
        }
    }
p count