n = gets.to_i items = n.times.map { gets.split.map(&:to_i)}.flatten.sort counts = (1..10).map{|i| count = items.count(i) count.divmod(2) } puts counts.inject(0) {|s,v| s + v[0]} + counts.inject(0) {|s,v| s + v[1] }.div(4)