N = int(input())
Target =  [0] * N

A = list(map(int, input().split()))
if A[0] != 0 :
    for i in range(A[0]) :
        Target[A[i+1]-1]  += 1

B = list(map(int, input().split()))
if B[0] != 0 :
    for i in range(B[0]) :
        Target[B[i+1]-1] += 2
    
C = list(map(int, input().split()))
if C[0] != 0 :
    for i in range(C[0]) :
        Target[C[i+1]-1] +=4

S = 0
for i in range(N) :
    if Target[i] == 4 or Target[i] == 6 or Target[i] == 7 :
        S += 1

print(S)

