n = gets.to_i array = gets.chomp.split(" ") hash = Hash.new(0) array.each{|value| hash[value] += 1 } puts hash.flatten.count(1)