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