#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU N = gets.to_i items = {} powerup = 0 N.times do abc = gets.chomp.split abc.each do |x| if items.include? x powerup += 1 items.delete x else items[x] = 1 end end end powerup += items.keys.size.div(4) puts powerup