items=Array.new(11,0) gets.to_i.times{ gets.split.map(&:to_i).each{|a|items[a]+=1} } ans=0 residue=0 items.each{|num| ans+=num/2 residue+=num%2 } p ans+(residue/4)