n = int(input())
s = input().split(" ")
S = list(map(int,s))
q = int(input())
t = input().split(" ")
T = list(map(int,t))
C = []
for i in range(n):
    flag = 0
    for k in range(len(C)):
        if S[i] == C[k]:
            flag = 1
            break
    if flag == 1:
        continue
    for j in range(q):
        if S[i] == T[j]:
            C.append(S[i])
            break
print(len(C)) n = int(input()) n int(input()) int input() input s = input().split(" ") s input().split(" ") ().split () input split " " S = list(map(int,s)) S list(map(int,s)) list map(int,s) map int s q = int(input()) q int(input()) int input() input t = input().split(" ") t input().split(" ") ().split () input split " " T = list(map(int,t)) T list(map(int,t)) list map(int,t) map int t C = [] C [] for i in range(n):
    flag = 0
    for k in range(len(C)):
        if S[i] == C[k]:
            flag = 1
            break
    if flag == 1:
        continue
    for j in range(q):
        if S[i] == T[j]:
            C.append(S[i])
            break i range(n) range n flag = 0 flag 0 for k in range(len(C)):
        if S[i] == C[k]:
            flag = 1
            break
     k range(len(C)) range len(C) len C if S[i] == C[k]:
            flag = 1
            break
     S[i] == C[k] S[i] S i C[k] C k flag = 1 flag 1 break if flag == 1:
        continue
     flag == 1 flag 1 continue for j in range(q):
        if S[i] == T[j]:
            C.append(S[i])
            break j range(q) range q if S[i] == T[j]:
            C.append(S[i])
            break S[i] == T[j] S[i] S i T[j] T j C.append(S[i]) C.append C append S[i] S i break print(len(C)) print len(C) len C T = list(map(int,t)) list(map(int,t)) T s = input().split(" ") input().split(" ") s S = list(map(int,s)) list(map(int,s)) S t = input().split(" ") input().split(" ") t n = int(input()) int(input()) n flag = 1 1 flag C = [] [] C q = int(input()) int(input()) q flag = 0 0 flag
n = int(input())
s = input().split(" ")
S = list(map(int,s))
q = int(input())
t = input().split(" ")
T = list(map(int,t))
C = []
for i in range(n):
    flag = 0
    for k in range(len(C)):
        if S[i] == C[k]:
            flag = 1
            break
    if flag == 1:
        continue
    for j in range(q):
        if S[i] == T[j]:
            C.append(S[i])
            break
print(len(C))