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