gets p gets.split.map(&:to_i).each_cons(3).filter{|g| Set.new(g).size == 3}.size