n1 = int(input())
nums1 = list(map(int, input().split()))
n2 = int(input())
nums2 = list(map(int, input().split()))

def linear_search(nums1, n1, key):
    nums1[n1] = key
    index = 0
    while nums1[index] != key:
        index += 1
    return index != n1

output = 0
nums1.append(None)
for key in nums2:
    if linear_search(nums1, n1, key):
        output += 1

print(output) n1 = int(input()) n1 int(input()) int input() input nums1 = list(map(int, input().split())) nums1 list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split n2 = int(input()) n2 int(input()) int input() input nums2 = list(map(int, input().split())) nums2 list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def linear_search(nums1, n1, key):
    nums1[n1] = key
    index = 0
    while nums1[index] != key:
        index += 1
    return index != n1 linear_search nums1[n1] = key nums1[n1] nums1 n1 key index = 0 index 0 while nums1[index] != key:
        index += 1
     nums1[index] != key nums1[index] nums1 index key index += 1 index 1 return index != n1 index != n1 index n1 nums1 nums1 n1 n1 key key output = 0 output 0 nums1.append(None) nums1.append nums1 append None for key in nums2:
    if linear_search(nums1, n1, key):
        output += 1 key nums2 if linear_search(nums1, n1, key):
        output += 1 linear_search(nums1, n1, key) linear_search nums1 n1 key output += 1 output 1 print(output) print output n2 = int(input()) int(input()) n2 nums2 = list(map(int, input().split())) list(map(int, input().split())) nums2 nums1 = list(map(int, input().split())) list(map(int, input().split())) nums1 output += 1 1 output n1 = int(input()) int(input()) n1 output = 0 0 output def linear_search(nums1, n1, key):
    nums1[n1] = key
    index = 0
    while nums1[index] != key:
        index += 1
    return index != n1 def linear_search(nums1, n1, key):
    nums1[n1] = key
    index = 0
    while nums1[index] != key:
        index += 1
    return index != n1 linear_search
n1 = int(input())
nums1 = list(map(int, input().split()))
n2 = int(input())
nums2 = list(map(int, input().split()))

def linear_search(nums1, n1, key):
    nums1[n1] = key
    index = 0
    while nums1[index] != key:
        index += 1
    return index != n1

output = 0
nums1.append(None)
for key in nums2:
    if linear_search(nums1, n1, key):
        output += 1

print(output)
