
import std.algorithm;
import std.array;
import std.range;
import std.conv;
import std.stdio;
import std.string;
import std.typecons;

alias FairyPos = Tuple!(int,int);

void main(){
    auto blue_num = readln.chomp.to!int;
    string[] blues;
    foreach(i; iota(0, blue_num)) {
        blues ~= readln.chomp;
    }
    auto red_num = readln.chomp.to!int;
    string[] reds;
    foreach(i; iota(0, red_num)) {
        reds ~= readln.chomp;
    }
    auto pluss = get_num_by_string(blues);
    // writeln(pluss);
    auto minus = get_num_by_string(reds);
    // writeln(minus);
    int[string] scores;
    foreach(str, num; pluss) {
        int minus_score = str in minus ? minus[str] : 0;
        scores[str] = pluss[str] - minus_score;
    }
    int max_num;
    foreach(score; scores) {
        max_num = score > max_num ? score : max_num;
    }
    max_num.writeln;
}

int[string] get_num_by_string(string[] raw){
    int[string] result;
    raw.each!((str){
        if(str in result){
            result[str]++;
        }else{
            result[str] = 1;
        }
    });
    return result;
}
