n = int(input())
s = input().split()
n = int(input())
t = input().split()
count = 0
for a in t:
    if a in s:
        count += 1
        
print(count) n = int(input()) n int(input()) int input() input s = input().split() s input().split() ().split () input split n = int(input()) n int(input()) int input() input t = input().split() t input().split() ().split () input split count = 0 count 0 for a in t:
    if a in s:
        count += 1
         a t if a in s:
        count += 1
         a in s a s count += 1 count 1 print(count) print count n = int(input()) int(input()) n n = int(input()) int(input()) n s = input().split() input().split() s t = input().split() input().split() t count = 0 0 count count += 1 1 count
n = int(input())
s = input().split()
n = int(input())
t = input().split()
count = 0
for a in t:
    if a in s:
        count += 1
        
print(count)