# -*- coding: utf-8 -*-


def linerSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        S.pop()
        return False
    S.pop()
    return True

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

count = 0

for i in range(q):
    if linerSearch(S, T[i]):
        count += 1

print (count) def linerSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        S.pop()
        return False
    S.pop()
    return True linerSearch i = 0 i 0 S.append(key) S.append S append key while S[i] != key:
        i += 1
     S[i] != key S[i] S i key i += 1 i 1 if i == len(S)-1:
        S.pop()
        return False
     i == len(S)-1 i len(S)-1 len(S) len S 1 S.pop() S.pop S pop return False False S.pop() S.pop S pop return True True S S 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 count = 0 count 0 for i in range(q):
    if linerSearch(S, T[i]):
        count += 1 i range(q) range q if linerSearch(S, T[i]):
        count += 1 linerSearch(S, T[i]) linerSearch S T[i] T i count += 1 count 1 print (count) print count n = int(input()) int(input()) n count = 0 0 count count += 1 1 count q = int(input()) int(input()) q def linerSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        S.pop()
        return False
    S.pop()
    return True def linerSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        S.pop()
        return False
    S.pop()
    return True linerSearch S = list(map(int, input().split())) list(map(int, input().split())) S T = list(map(int, input().split())) list(map(int, input().split())) T
# -*- coding: utf-8 -*-


def linerSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        S.pop()
        return False
    S.pop()
    return True

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

count = 0

for i in range(q):
    if linerSearch(S, T[i]):
        count += 1

print (count)