def linear_search(arr, key):
    idx = 0
    while arr[idx] != key:
        idx += 1

    if idx == len(arr) - 1:
        return False

    return True


n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

s.append(None)
cnt = 0
for i in range(q):
    s[n] = t[i]
    if linear_search(s, t[i]):
        cnt += 1

print(cnt)
 def linear_search(arr, key):
    idx = 0
    while arr[idx] != key:
        idx += 1

    if idx == len(arr) - 1:
        return False

    return True linear_search idx = 0 idx 0 while arr[idx] != key:
        idx += 1

     arr[idx] != key arr[idx] arr idx key idx += 1 idx 1 if idx == len(arr) - 1:
        return False

     idx == len(arr) - 1 idx len(arr) - 1 len(arr) len arr 1 return False False return True True arr arr 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 s.append(None) s.append s append None cnt = 0 cnt 0 for i in range(q):
    s[n] = t[i]
    if linear_search(s, t[i]):
        cnt += 1 i range(q) range q s[n] = t[i] s[n] s n t[i] t i if linear_search(s, t[i]):
        cnt += 1 linear_search(s, t[i]) linear_search s t[i] t i cnt += 1 cnt 1 print(cnt) print cnt q = int(input()) int(input()) q n = int(input()) int(input()) n def linear_search(arr, key):
    idx = 0
    while arr[idx] != key:
        idx += 1

    if idx == len(arr) - 1:
        return False

    return True def linear_search(arr, key):
    idx = 0
    while arr[idx] != key:
        idx += 1

    if idx == len(arr) - 1:
        return False

    return True linear_search s = list(map(int, input().split())) list(map(int, input().split())) s cnt += 1 1 cnt t = list(map(int, input().split())) list(map(int, input().split())) t cnt = 0 0 cnt
def linear_search(arr, key):
    idx = 0
    while arr[idx] != key:
        idx += 1

    if idx == len(arr) - 1:
        return False

    return True


n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

s.append(None)
cnt = 0
for i in range(q):
    s[n] = t[i]
    if linear_search(s, t[i]):
        cnt += 1

print(cnt)

