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

count = 0
for key in T:
    U = S + [key]
    i = 0
    while U[i] != key:
        i = i+1
    if i != n:
        count = count + 1
print(count) n = int(input()) n int(input()) int input() input S = list(input().split()) S list(input().split()) list input().split() ().split () input split q = input() q input() input T = input().split() T input().split() ().split () input split count = 0 count 0 for key in T:
    U = S + [key]
    i = 0
    while U[i] != key:
        i = i+1
    if i != n:
        count = count + 1 key T U = S + [key] U S + [key] S [key] key i = 0 i 0 while U[i] != key:
        i = i+1
     U[i] != key U[i] U i key i = i+1 i i+1 i 1 if i != n:
        count = count + 1 i != n i n count = count + 1 count count + 1 count 1 print(count) print count count = count + 1 count + 1 count U = S + [key] S + [key] U S = list(input().split()) list(input().split()) S T = input().split() input().split() T count = 0 0 count n = int(input()) int(input()) n q = input() input() q i = 0 0 i i = i+1 i+1 i
n = int(input())
S = list(input().split())
q = input()
T = input().split()

count = 0
for key in T:
    U = S + [key]
    i = 0
    while U[i] != key:
        i = i+1
    if i != n:
        count = count + 1
print(count)