if __name__ == "__main__":
    n = int(input())
    S = list(map(int, input().split()))
    q = int(input())
    T = list(map(int, input().split()))
    ans = 0
    for i in T:
        if i in S:
            ans += 1
    print(ans) if __name__ == "__main__":
    n = int(input())
    S = list(map(int, input().split()))
    q = int(input())
    T = list(map(int, input().split()))
    ans = 0
    for i in T:
        if i in S:
            ans += 1
    print(ans) __name__ == "__main__" __name__ "__main__" 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 ans = 0 ans 0 for i in T:
        if i in S:
            ans += 1
     i T if i in S:
            ans += 1
     i in S i S ans += 1 ans 1 print(ans) print ans q = int(input()) int(input()) q ans += 1 1 ans S = list(map(int, input().split())) list(map(int, input().split())) S n = int(input()) int(input()) n ans = 0 0 ans T = list(map(int, input().split())) list(map(int, input().split())) T
if __name__ == "__main__":
    n = int(input())
    S = list(map(int, input().split()))
    q = int(input())
    T = list(map(int, input().split()))
    ans = 0
    for i in T:
        if i in S:
            ans += 1
    print(ans)