def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0


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

print(sum([linearSearch(key, arr2) for key in arr1]))
 def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0 linearSearch for e in list:
        if key == e:
            return 1
     e list if key == e:
            return 1
     key == e key e return 1 1 return 0 0 key key list list 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 = list(set([int(n) for n in input().split()])) arr1 list(set([int(n) for n in input().split()])) list set([int(n) for n in input().split()]) set [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 = list(set([int(n) for n in input().split()])) arr2 list(set([int(n) for n in input().split()])) list set([int(n) for n in input().split()]) set [int(n) for n in input().split()] linearSearch(key, arr2) for key in arr1 for key in arr1 key arr1 for key in arr1 linearSearch(key, arr2) linearSearch key arr2 print(sum([linearSearch(key, arr2) for key in arr1])) print sum([linearSearch(key, arr2) for key in arr1]) sum [linearSearch(key, arr2) for key in arr1] def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0 def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0 linearSearch arr1 = list(set([int(n) for n in input().split()])) list(set([int(n) for n in input().split()])) arr1 N2 = int(input()) int(input()) N2 N1 = int(input()) int(input()) N1 arr2 = list(set([int(n) for n in input().split()])) list(set([int(n) for n in input().split()])) arr2
def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0


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

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

