gets h = Hash.new{0} $stdin.read.split.map(&:to_i).each do |item| h[item] += 1 end count = 0 h.each do |item, num| q, r = num.divmod(2) count += q h[item] = r end count += h.values.inject(&:+) / 4 puts count