gets numbers = gets.split.map(&:to_i) puts numbers.inject(0) { |count, i| numbers.count(i) == 1 ? count += 1 : count }