c = 0
input()
s = input().split()
input()
t = input().split()
for make in t :
    if make in s : c += 1
print(c) c = 0 c 0 input() input s = input().split() s input().split() ().split () input split input() input t = input().split() t input().split() ().split () input split for make in t :
    if make in s : c += 1 make t if make in s : c  make in s make s print(c) print c t = input().split() input().split() t s = input().split() input().split() s c = 0 0 c
c = 0
input()
s = input().split()
input()
t = input().split()
for make in t :
    if make in s : c += 1
print(c)