first_set_count = int(input());
first_set = [int(n) for n in input().split()];
second_set_count = int(input());
second_set = [int(n) for n in input().split()];

def linear_search(first_set, second_set):
    count = 0;
    for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
    print(count);

linear_search(first_set, second_set); first_set_count = int(input()) first_set_count int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n first_set = [int(n) for n in input().split()] first_set [int(n) for n in input().split()] second_set_count = int(input()) second_set_count int(input()) int input() input int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n second_set = [int(n) for n in input().split()] second_set [int(n) for n in input().split()] def linear_search(first_set, second_set):
    count = 0;
    for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
    print(count); linear_search count = 0 count 0 for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
     n second_set for m in first_set:
            if n == m:
                count += 1;
                break;
     m first_set if n == m:
                count += 1;
                break;
     n == m n m count += 1 count 1 break print(count) print count first_set first_set second_set second_set linear_search(first_set, second_set) linear_search first_set second_set second_set_count = int(input()) int(input()) second_set_count first_set_count = int(input()) int(input()) first_set_count first_set = [int(n) for n in input().split()] [int(n) for n in input().split()] first_set second_set = [int(n) for n in input().split()] [int(n) for n in input().split()] second_set def linear_search(first_set, second_set):
    count = 0;
    for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
    print(count); def linear_search(first_set, second_set):
    count = 0;
    for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
    print(count); linear_search
first_set_count = int(input());
first_set = [int(n) for n in input().split()];
second_set_count = int(input());
second_set = [int(n) for n in input().split()];

def linear_search(first_set, second_set):
    count = 0;
    for n in second_set:
        for m in first_set:
            if n == m:
                count += 1;
                break;
    print(count);

linear_search(first_set, second_set);
