n = gets.to_i
bits = [0, 0, 0]
3.times do |i|
    gets.split.map(&:to_i)[1..-1].each do |j|
        bits[i] |= (1 << (j - 1))
    end
end
a, b, c = bits
x = (c - (c & a)) | (c & b)
puts x.to_s(2).count(?1)
