import std.stdio, std.algorithm, std.range, std.format, std.numeric, std.string, std.conv, std.array;

void main() {
    size_t n, m;
    long[string] count;
    readf("%d\n", &n);
    foreach (i; 0 .. n) {
        const k = readln();
        count[k] = count.get(k, 0) + 1;
    }
    readf("%d\n", &m);
    foreach (i; 0 .. m) {
        const k = readln();
        count[k] = count.get(k, 0) - 1;
    }
    writeln(max(0, reduce!max(count.byValue)));
}