n = int(input())
s = list(map(int, input().split()))

q = int(input())
t = list(map(int, input().split()))

count = 0
for i in range(len(t)):
    if t[i] in s:
        count += 1
print(count) 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 count = 0 count 0 for i in range(len(t)):
    if t[i] in s:
        count += 1 i range(len(t)) range len(t) len t if t[i] in s:
        count += 1 t[i] in s t[i] t i s count += 1 count 1 print(count) print count n = int(input()) int(input()) n s = list(map(int, input().split())) list(map(int, input().split())) s q = int(input()) int(input()) q t = list(map(int, input().split())) list(map(int, input().split())) t count = 0 0 count count += 1 1 count
n = int(input())
s = list(map(int, input().split()))

q = int(input())
t = list(map(int, input().split()))

count = 0
for i in range(len(t)):
    if t[i] in s:
        count += 1
print(count)