nS = int(input())
S = list(map(int,input().split()))
nQ = int(input())
Q = list(map(int,input().split()))

cnt = 0

for i in range(nQ):
    copy_S = S.copy()
    copy_S.append(Q[i])

    j = 0
    while copy_S[j] != Q[i]:
        j += 1
    if j < len(copy_S)-1 : cnt += 1

print(cnt) nS = int(input()) nS 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 nQ = int(input()) nQ int(input()) int input() input Q = list(map(int,input().split())) Q list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(nQ):
    copy_S = S.copy()
    copy_S.append(Q[i])

    j = 0
    while copy_S[j] != Q[i]:
        j += 1
    if j < len(copy_S)-1 : cnt += 1 i range(nQ) range nQ copy_S = S.copy() copy_S S.copy() S.copy S copy copy_S.append(Q[i]) copy_S.append copy_S append Q[i] Q i j = 0 j 0 while copy_S[j] != Q[i]:
        j += 1
     copy_S[j] != Q[i] copy_S[j] copy_S j Q[i] Q i j += 1 j 1 if j < len(copy_S)-1 : cnt  j < len(copy_S)-1 j len(copy_S)-1 len(copy_S) len copy_S 1 print(cnt) print cnt nS = int(input()) int(input()) nS copy_S = S.copy() S.copy() copy_S cnt = 0 0 cnt Q = list(map(int,input().split())) list(map(int,input().split())) Q S = list(map(int,input().split())) list(map(int,input().split())) S nQ = int(input()) int(input()) nQ j += 1 1 j j = 0 0 j
nS = int(input())
S = list(map(int,input().split()))
nQ = int(input())
Q = list(map(int,input().split()))

cnt = 0

for i in range(nQ):
    copy_S = S.copy()
    copy_S.append(Q[i])

    j = 0
    while copy_S[j] != Q[i]:
        j += 1
    if j < len(copy_S)-1 : cnt += 1

print(cnt)
