def liner_search(r,key):
    for x in r:
        if x == key:
            return True
    return False


N = int(input())
S = list(map(int, input().split()))
q = int(input())
Key = list(map(int, input().split()))
cnt = 0
for i in range(q):
    if liner_search(S, Key[i]):
        cnt += 1

print(cnt) def liner_search(r,key):
    for x in r:
        if x == key:
            return True
    return False liner_search for x in r:
        if x == key:
            return True
     x r if x == key:
            return True
     x == key x key return True True return False False r r 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 Key = list(map(int, input().split())) Key list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(q):
    if liner_search(S, Key[i]):
        cnt += 1 i range(q) range q if liner_search(S, Key[i]):
        cnt += 1 liner_search(S, Key[i]) liner_search S Key[i] Key i cnt += 1 cnt 1 print(cnt) print cnt def liner_search(r,key):
    for x in r:
        if x == key:
            return True
    return False def liner_search(r,key):
    for x in r:
        if x == key:
            return True
    return False liner_search cnt = 0 0 cnt cnt += 1 1 cnt N = int(input()) int(input()) N Key = list(map(int, input().split())) list(map(int, input().split())) Key S = list(map(int, input().split())) list(map(int, input().split())) S q = int(input()) int(input()) q
def liner_search(r,key):
    for x in r:
        if x == key:
            return True
    return False


N = int(input())
S = list(map(int, input().split()))
q = int(input())
Key = list(map(int, input().split()))
cnt = 0
for i in range(q):
    if liner_search(S, Key[i]):
        cnt += 1

print(cnt)