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


def solve(s, t):
    cnt = 0
    for i in t:
        if i in s:
            cnt += 1
    return cnt


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


def solve(s, t):
    cnt = 0
    for i in t:
        if i in s:
            cnt += 1
    return cnt


print(solve(S, T))