_,*A=$<.map &:to_i p A.combination(3).count{2>_1.gcd(_2.gcd _3)}