def linear_search(num_list,target):
    for num in num_list:
        if num == target:
            return 1
    return 0

n = input()
num_list = list(map(int,input().split()))
q = input()
target_list = list(map(int,input().split()))
ans = 0

for target in target_list:
    ans += linear_search(num_list,target)
print(ans) def linear_search(num_list,target):
    for num in num_list:
        if num == target:
            return 1
    return 0 linear_search for num in num_list:
        if num == target:
            return 1
     num num_list if num == target:
            return 1
     num == target num target return 1 1 return 0 0 num_list num_list target target n = input() n input() input num_list = list(map(int,input().split())) num_list list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split q = input() q input() input target_list = list(map(int,input().split())) target_list list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = 0 ans 0 for target in target_list:
    ans += linear_search(num_list,target) target target_list ans += linear_search(num_list,target) ans linear_search(num_list,target) linear_search num_list target print(ans) print ans def linear_search(num_list,target):
    for num in num_list:
        if num == target:
            return 1
    return 0 def linear_search(num_list,target):
    for num in num_list:
        if num == target:
            return 1
    return 0 linear_search target_list = list(map(int,input().split())) list(map(int,input().split())) target_list q = input() input() q ans += linear_search(num_list,target) linear_search(num_list,target) ans num_list = list(map(int,input().split())) list(map(int,input().split())) num_list ans = 0 0 ans n = input() input() n
def linear_search(num_list,target):
    for num in num_list:
        if num == target:
            return 1
    return 0

n = input()
num_list = list(map(int,input().split()))
q = input()
target_list = list(map(int,input().split()))
ans = 0

for target in target_list:
    ans += linear_search(num_list,target)
print(ans)
