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

ans = sum([1 for tmp_t in T if tmp_t in S])

print(ans) n = int(input()) n int(input()) int input() input S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = list(map(int, input().split())) T list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split 1 for tmp_t in T if tmp_t in S for tmp_t in T if tmp_t in S tmp_t T tmp_t in S tmp_t S if tmp_t in S 1 ans = sum([1 for tmp_t in T if tmp_t in S]) ans sum([1 for tmp_t in T if tmp_t in S]) sum [1 for tmp_t in T if tmp_t in S] print(ans) print ans n = int(input()) int(input()) n S = list(map(int, input().split())) list(map(int, input().split())) S q = int(input()) int(input()) q ans = sum([1 for tmp_t in T if tmp_t in S]) sum([1 for tmp_t in T if tmp_t in S]) ans T = list(map(int, input().split())) list(map(int, input().split())) T
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

ans = sum([1 for tmp_t in T if tmp_t in S])

print(ans)