n = int(input())
s = list(map(int, input().split()))

q = int(input())
t = list(map(int, input().split()))

count = 0

for i in range(q):
    s.append(t[i])
    j = 0
    while t[i] != s[j]:
        j += 1
    if j != n:
        count += 1
    del s[n]
print(count) 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 count = 0 count 0 for i in range(q):
    s.append(t[i])
    j = 0
    while t[i] != s[j]:
        j += 1
    if j != n:
        count += 1
    del s[n] i range(q) range q s.append(t[i]) s.append s append t[i] t i j = 0 j 0 while t[i] != s[j]:
        j += 1
     t[i] != s[j] t[i] t i s[j] s j j += 1 j 1 if j != n:
        count += 1
     j != n j n count += 1 count 1 del s[n] s[n] s n print(count) print count t = list(map(int, input().split())) list(map(int, input().split())) t count = 0 0 count q = int(input()) int(input()) q count += 1 1 count j += 1 1 j s = list(map(int, input().split())) list(map(int, input().split())) s j = 0 0 j n = int(input()) int(input()) n
n = int(input())
s = list(map(int, input().split()))

q = int(input())
t = list(map(int, input().split()))

count = 0

for i in range(q):
    s.append(t[i])
    j = 0
    while t[i] != s[j]:
        j += 1
    if j != n:
        count += 1
    del s[n]
print(count)
