n = int(input())
S = list(map(int, input().split(' ')))
q = int(input())
T = list(map(int, input().split(' ')))
counter = 0
for t in  T:
    for s in S:
        if(s == t):
            counter += 1
            break

print(counter)
 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 ' ' counter = 0 counter 0 for t in  T:
    for s in S:
        if(s == t):
            counter += 1
            break t T for s in S:
        if(s == t):
            counter += 1
            break s S if(s == t):
            counter += 1
            break s == t s t counter += 1 counter 1 break print(counter) print counter n = int(input()) int(input()) n counter = 0 0 counter counter += 1 1 counter S = list(map(int, input().split(' '))) list(map(int, input().split(' '))) S q = int(input()) int(input()) q T = list(map(int, input().split(' '))) list(map(int, input().split(' '))) T
n = int(input())
S = list(map(int, input().split(' ')))
q = int(input())
T = list(map(int, input().split(' ')))
counter = 0
for t in  T:
    for s in S:
        if(s == t):
            counter += 1
            break

print(counter)

