def linear_search(li, value):
    for x in li:
        if x == value:
            return True
    return False

input() # n
S = [int(x) for x in input().split()] 
input() # q
T = [int(x) for x in input().split()]

ans = 0

for x in T:
    if linear_search(S, x):
        ans += 1

print(ans) def linear_search(li, value):
    for x in li:
        if x == value:
            return True
    return False linear_search for x in li:
        if x == value:
            return True
     x li if x == value:
            return True
     x == value x value return True True return False False li li value value input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x S = [int(x) for x in input().split()] S [int(x) for x in input().split()] input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x T = [int(x) for x in input().split()] T [int(x) for x in input().split()] ans = 0 ans 0 for x in T:
    if linear_search(S, x):
        ans += 1 x T if linear_search(S, x):
        ans += 1 linear_search(S, x) linear_search S x ans += 1 ans 1 print(ans) print ans S = [int(x) for x in input().split()] [int(x) for x in input().split()] S ans += 1 1 ans def linear_search(li, value):
    for x in li:
        if x == value:
            return True
    return False def linear_search(li, value):
    for x in li:
        if x == value:
            return True
    return False linear_search ans = 0 0 ans T = [int(x) for x in input().split()] [int(x) for x in input().split()] T
def linear_search(li, value):
    for x in li:
        if x == value:
            return True
    return False

input() # n
S = [int(x) for x in input().split()] 
input() # q
T = [int(x) for x in input().split()]

ans = 0

for x in T:
    if linear_search(S, x):
        ans += 1

print(ans)