#coding:utf-8
#1_4_A
def isFound(array, x):
    """ linear search """
    array.append(x)
    i = 0
    while array[i] != x:
        i += 1
    if i == len(array)-1:
        return False
    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 isFound(S, T[i]):
        count += 1

print(count) def isFound(array, x):
    """ linear search """
    array.append(x)
    i = 0
    while array[i] != x:
        i += 1
    if i == len(array)-1:
        return False
    return True isFound """ linear search """ array.append(x) array.append array append x i = 0 i 0 while array[i] != x:
        i += 1
     array[i] != x array[i] array i x i += 1 i 1 if i == len(array)-1:
        return False
     i == len(array)-1 i len(array)-1 len(array) len array 1 return False False return True True array array x x 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 isFound(S, T[i]):
        count += 1 i range(q) range q if isFound(S, T[i]):
        count += 1 isFound(S, T[i]) isFound S T[i] T i count += 1 count 1 print(count) print count S = list(map(int, input().split())) list(map(int, input().split())) S T = list(map(int, input().split())) list(map(int, input().split())) T def isFound(array, x):
    """ linear search """
    array.append(x)
    i = 0
    while array[i] != x:
        i += 1
    if i == len(array)-1:
        return False
    return True def isFound(array, x):
    """ linear search """
    array.append(x)
    i = 0
    while array[i] != x:
        i += 1
    if i == len(array)-1:
        return False
    return True isFound n = int(input()) int(input()) n q = int(input()) int(input()) q count = 0 0 count count += 1 1 count
#coding:utf-8
#1_4_A
def isFound(array, x):
    """ linear search """
    array.append(x)
    i = 0
    while array[i] != x:
        i += 1
    if i == len(array)-1:
        return False
    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 isFound(S, T[i]):
        count += 1

print(count)