import std.stdio, std.string, std.array, std.conv;

bool linearSearch(int n, int key, int[] x) {
    int i = 0;
    x ~= key;
    while (x[i] != key) ++i;
    return i != n;
}

void main() {
    int n = readln.chomp.to!int;
    int[] s = readln.chomp.split.to!(int[]);
    int q = readln.chomp.to!int;
    int[] t = readln.chomp.split.to!(int[]);
    int cnt = 0;
    foreach (x; t) {
        if (linearSearch(n, x, s)) ++cnt;
    }
    cnt.writeln;
}
