n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
cnt = 0
for i in T:
    m = 0
    S.append(i)
    while i != S[m]:
        m+=1
    if m != n:
        cnt+=1
    S.pop()
print(cnt) 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 cnt = 0 cnt 0 for i in T:
    m = 0
    S.append(i)
    while i != S[m]:
        m+=1
    if m != n:
        cnt+=1
    S.pop() i T m = 0 m 0 S.append(i) S.append S append i while i != S[m]:
        m+=1
     i != S[m] i S[m] S m m+=1 m 1 if m != n:
        cnt+=1
     m != n m n cnt+=1 cnt 1 S.pop() S.pop S pop print(cnt) print cnt m+=1 1 m cnt+=1 1 cnt m = 0 0 m q = int(input()) int(input()) q cnt = 0 0 cnt S = list(map(int, input().split())) list(map(int, input().split())) S T = list(map(int, input().split())) list(map(int, input().split())) T n = int(input()) int(input()) n
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
cnt = 0
for i in T:
    m = 0
    S.append(i)
    while i != S[m]:
        m+=1
    if m != n:
        cnt+=1
    S.pop()
print(cnt)
