gets;p ($<.map &:to_i).combination(3).map{|b|b.inject(:gcd)<2?1:0}.sum