def linearSearch(key, list, N):
    l = list + [key]
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N)


N1 = int(input())
arr1 = [int(n) for n in input().split()]
N2 = int(input())
arr2 = [int(n) for n in input().split()]

print(sum([linearSearch(key, arr1, N1) for key in arr2]))
 def linearSearch(key, list, N):
    l = list + [key]
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N) linearSearch l = list + [key] l list + [key] list [key] key i = 0 i 0 while l[i] != key:
        i += 1
     l[i] != key l[i] l i key i += 1 i 1 return int(i != N) int(i != N) int i != N i N key key list list N N N1 = int(input()) N1 int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n arr1 = [int(n) for n in input().split()] arr1 [int(n) for n in input().split()] N2 = int(input()) N2 int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n arr2 = [int(n) for n in input().split()] arr2 [int(n) for n in input().split()] linearSearch(key, arr1, N1) for key in arr2 for key in arr2 key arr2 for key in arr2 linearSearch(key, arr1, N1) linearSearch key arr1 N1 print(sum([linearSearch(key, arr1, N1) for key in arr2])) print sum([linearSearch(key, arr1, N1) for key in arr2]) sum [linearSearch(key, arr1, N1) for key in arr2] N1 = int(input()) int(input()) N1 arr1 = [int(n) for n in input().split()] [int(n) for n in input().split()] arr1 arr2 = [int(n) for n in input().split()] [int(n) for n in input().split()] arr2 N2 = int(input()) int(input()) N2 def linearSearch(key, list, N):
    l = list + [key]
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N) def linearSearch(key, list, N):
    l = list + [key]
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N) linearSearch
def linearSearch(key, list, N):
    l = list + [key]
    i = 0
    while l[i] != key:
        i += 1
    return int(i != N)


N1 = int(input())
arr1 = [int(n) for n in input().split()]
N2 = int(input())
arr2 = [int(n) for n in input().split()]

print(sum([linearSearch(key, arr1, N1) for key in arr2]))

