n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
def liner_search(S, key):
    for i in S:
        if i == key:
            return True
    return False
print(sum(liner_search(S, key) for key in T)) 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 def liner_search(S, key):
    for i in S:
        if i == key:
            return True
    return False liner_search for i in S:
        if i == key:
            return True
     i S if i == key:
            return True
     i == key i key return True True return False False S S key key print(sum(liner_search(S, key) for key in T)) print sum(liner_search(S, key) for key in T) sum liner_search(S, key) liner_search S key S = list(map(int, input().split())) list(map(int, input().split())) S q = int(input()) int(input()) q n = int(input()) int(input()) n T = list(map(int, input().split())) list(map(int, input().split())) T def liner_search(S, key):
    for i in S:
        if i == key:
            return True
    return False def liner_search(S, key):
    for i in S:
        if i == key:
            return True
    return False liner_search
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
def liner_search(S, key):
    for i in S:
        if i == key:
            return True
    return False
print(sum(liner_search(S, key) for key in T))
