def linerSearch(A, key):
    for i in A:
        if i == key:
            return 1
    return 0

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
c=0
for j in T:
    if linerSearch(S, j) != 0:
        c += 1
print(c) def linerSearch(A, key):
    for i in A:
        if i == key:
            return 1
    return 0 linerSearch for i in A:
        if i == key:
            return 1
     i A if i == key:
            return 1
     i == key i key return 1 1 return 0 0 A A key key n = int(input()) n int(input()) int input() input S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = list(map(int, input().split())) T list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split c=0 c 0 for j in T:
    if linerSearch(S, j) != 0:
        c += 1 j T if linerSearch(S, j) != 0:
        c += 1 linerSearch(S, j) != 0 linerSearch(S, j) linerSearch S j 0 c += 1 c 1 print(c) print c def linerSearch(A, key):
    for i in A:
        if i == key:
            return 1
    return 0 def linerSearch(A, key):
    for i in A:
        if i == key:
            return 1
    return 0 linerSearch q = int(input()) int(input()) q c=0 0 c c += 1 1 c S = list(map(int, input().split())) list(map(int, input().split())) S n = int(input()) int(input()) n T = list(map(int, input().split())) list(map(int, input().split())) T
def linerSearch(A, key):
    for i in A:
        if i == key:
            return 1
    return 0

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
c=0
for j in T:
    if linerSearch(S, j) != 0:
        c += 1
print(c)
