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

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

S.append(-1)
sum = 0
for i in T:
    count = 0
    while True:
        if i != S[count]:
            count += 1
        else:
            sum += 1
            break
        if S[count] == -1:
            break
print(sum)