n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = map(int, 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(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 = map(int, input().split()) T map(int, input().split()) map int 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 n = int(input()) int(input()) n S = list(map(int, input().split())) list(map(int, input().split())) S i = 0 0 i T = map(int, input().split()) map(int, input().split()) T U = S + [key] S + [key] U count = 0 0 count i = i+1 i+1 i q = int(input()) int(input()) q count = count + 1 count + 1 count
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = map(int, 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)