def main(arr,like,unlike):
add = 0
minus = 0
# like = len(arr.intersection(like))
# unlike = len(arr.intersection(unlike))
for i in arr:
if i in like:
add += 1
if i in unlike:
minus +=1
print(add - minus)
if __name__ =="__main__":
n,m = input().split()
arr = list(map(int,input().split()))
like = set(map(int,input().split()))
unlike = set(map(int,input().split()))
main(arr,like,unlike)