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


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


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) for key in arr2]))

