n=int(input())
member=[0]*(n+1)
count=0
a=list(map(int,input().split()))
for i in range(1,a[0]+1):
    member[a[i]]+=1
b=list(map(int,input().split()))
for i in range(1,b[0]+1):
    member[b[i]]+=2
c=list(map(int,input().split()))
for i in range(1,c[0]+1):
    member[c[i]]+=4
for i in member:
    if i==4 or i>5:count+=1
print(count)
