n = int(input())
S = set(map(int, input().split()))
q = int(input())
T = set(map(int, input().split()))

ans = 0
for t in T:
    ans += 1 if t in S else 0
print(ans)
 n = int(input()) n int(input()) int input() input S = set(map(int, input().split())) S set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = set(map(int, input().split())) T set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for t in T:
    ans += 1 if t in S else 0 t T ans += 1 if t in S else 0 ans 1 if t in S else 0 t in S t S 1 0 print(ans) print ans q = int(input()) int(input()) q ans = 0 0 ans S = set(map(int, input().split())) set(map(int, input().split())) S T = set(map(int, input().split())) set(map(int, input().split())) T ans += 1 if t in S else 0 1 if t in S else 0 ans n = int(input()) int(input()) n
n = int(input())
S = set(map(int, input().split()))
q = int(input())
T = set(map(int, input().split()))

ans = 0
for t in T:
    ans += 1 if t in S else 0
print(ans)

