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


void main()
{
    uint count = 0;
    auto n = chomp(readln());
    auto s = split(readln());
    auto q = to!(int)(chomp(readln()));
    auto t = split(readln());
    
    foreach (i; t)
        foreach (j; s)
            if (i == j) {count++; break;}

    writeln(count);
}