n1 = int(raw_input())
nums1 = map(int, raw_input().split(" "))
n2 = int(raw_input())
nums2 = map(int, raw_input().split(" "))
nums1.append(-1)
count = 0

for key in nums2:
    nums1[len(nums1)-1] = key
    idx = 0

    while nums1[idx] != key:
        idx += 1

    if idx != len(nums1)-1:
        count += 1

print(count) n1 = int(raw_input()) n1 int(raw_input()) int raw_input() raw_input nums1 = map(int, raw_input().split(" ")) nums1 map(int, raw_input().split(" ")) map int raw_input().split(" ") ().split () raw_input split " " n2 = int(raw_input()) n2 int(raw_input()) int raw_input() raw_input nums2 = map(int, raw_input().split(" ")) nums2 map(int, raw_input().split(" ")) map int raw_input().split(" ") ().split () raw_input split " " nums1.append(-1) nums1.append nums1 append -1 count = 0 count 0 for key in nums2:
    nums1[len(nums1)-1] = key
    idx = 0

    while nums1[idx] != key:
        idx += 1

    if idx != len(nums1)-1:
        count += 1 key nums2 nums1[len(nums1)-1] = key nums1[len(nums1)-1] nums1 len(nums1)-1 len(nums1) len nums1 1 key idx = 0 idx 0 while nums1[idx] != key:
        idx += 1

     nums1[idx] != key nums1[idx] nums1 idx key idx += 1 idx 1 if idx != len(nums1)-1:
        count += 1 idx != len(nums1)-1 idx len(nums1)-1 len(nums1) len nums1 1 count += 1 count 1 print(count) print count count = 0 0 count n2 = int(raw_input()) int(raw_input()) n2 idx = 0 0 idx idx += 1 1 idx nums1 = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) nums1 count += 1 1 count n1 = int(raw_input()) int(raw_input()) n1 nums2 = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) nums2
n1 = int(raw_input())
nums1 = map(int, raw_input().split(" "))
n2 = int(raw_input())
nums2 = map(int, raw_input().split(" "))
nums1.append(-1)
count = 0

for key in nums2:
    nums1[len(nums1)-1] = key
    idx = 0

    while nums1[idx] != key:
        idx += 1

    if idx != len(nums1)-1:
        count += 1

print(count)