gets; a = Hash.new(0) gets.chomp.split.each do |str| if a.has_key? str a[str] += 1 else a[str] = 1 end end puts a.select {|k,v| v == 1}.size