def linearSearch(A, key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == len(A)-1:
        A.pop()
        return 'Not_found'
    A.pop()
    return i

if __name__ == '__main__':
    c = 0
    n = int(input())
    hoge1 = [int(x) for x in input().split()]
    q = int(input())
    for key in (int(x) for x in input().split()):
        if linearSearch(hoge1, key) == 'Not_found':
            continue
        else:
            c += 1
    print (c) def linearSearch(A, key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == len(A)-1:
        A.pop()
        return 'Not_found'
    A.pop()
    return i linearSearch i = 0 i 0 A.append(key) A.append A append key while A[i] != key:
        i += 1
     A[i] != key A[i] A i key i += 1 i 1 if i == len(A)-1:
        A.pop()
        return 'Not_found'
     i == len(A)-1 i len(A)-1 len(A) len A 1 A.pop() A.pop A pop return 'Not_found' 'Not_found' A.pop() A.pop A pop return i i A A key key if __name__ == '__main__':
    c = 0
    n = int(input())
    hoge1 = [int(x) for x in input().split()]
    q = int(input())
    for key in (int(x) for x in input().split()):
        if linearSearch(hoge1, key) == 'Not_found':
            continue
        else:
            c += 1
    print (c) __name__ == '__main__' __name__ '__main__' c = 0 c 0 n = int(input()) n int(input()) int 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 hoge1 = [int(x) for x in input().split()] hoge1 [int(x) for x in input().split()] q = int(input()) q int(input()) int input() input for key in (int(x) for x in input().split()):
        if linearSearch(hoge1, key) == 'Not_found':
            continue
        else:
            c += 1
     key (int(x) for x in input().split()) if linearSearch(hoge1, key) == 'Not_found':
            continue
        else:
            c += 1
     linearSearch(hoge1, key) == 'Not_found' linearSearch(hoge1, key) linearSearch hoge1 key 'Not_found' continue c += 1 c 1 print (c) print c c = 0 0 c def linearSearch(A, key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == len(A)-1:
        A.pop()
        return 'Not_found'
    A.pop()
    return i def linearSearch(A, key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == len(A)-1:
        A.pop()
        return 'Not_found'
    A.pop()
    return i linearSearch n = int(input()) int(input()) n hoge1 = [int(x) for x in input().split()] [int(x) for x in input().split()] hoge1 q = int(input()) int(input()) q c += 1 1 c
def linearSearch(A, key):
    i = 0
    A.append(key)
    while A[i] != key:
        i += 1
    if i == len(A)-1:
        A.pop()
        return 'Not_found'
    A.pop()
    return i

if __name__ == '__main__':
    c = 0
    n = int(input())
    hoge1 = [int(x) for x in input().split()]
    q = int(input())
    for key in (int(x) for x in input().split()):
        if linearSearch(hoge1, key) == 'Not_found':
            continue
        else:
            c += 1
    print (c)
