n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))


def linear_search(series, key):
    for x in series:
        if key == x:
            return 1
    return 0

cnt = 0
for t in T:
    cnt += linear_search(S, t)
print(cnt) 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 def linear_search(series, key):
    for x in series:
        if key == x:
            return 1
    return 0 linear_search for x in series:
        if key == x:
            return 1
     x series if key == x:
            return 1
     key == x key x return 1 1 return 0 0 series series key key cnt = 0 cnt 0 for t in T:
    cnt += linear_search(S, t) t T cnt += linear_search(S, t) cnt linear_search(S, t) linear_search S t print(cnt) print cnt def linear_search(series, key):
    for x in series:
        if key == x:
            return 1
    return 0 def linear_search(series, key):
    for x in series:
        if key == x:
            return 1
    return 0 linear_search cnt += linear_search(S, t) linear_search(S, t) cnt q = int(input()) int(input()) q cnt = 0 0 cnt T = list(map(int, input().split())) list(map(int, input().split())) T S = list(map(int, input().split())) list(map(int, input().split())) S n = int(input()) int(input()) n
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))


def linear_search(series, key):
    for x in series:
        if key == x:
            return 1
    return 0

cnt = 0
for t in T:
    cnt += linear_search(S, t)
print(cnt)
