function Main(s) {
	s = s.split("\n");
	var n = parseInt(s[0]);
	var a = {0:0};
	for(var i = 0; i < n; i++){
		if(!a[s[i+1]]) a[s[i+1]] = 1;
		else a[s[i+1]]++;
	}
	var m = parseInt(s[n+1]);
	for(var i = 0; i < m; i++){
		if(a[s[n+i+2]]) a[s[n+i+2]]--;
	}
	var max = 0;
	for(i in a){
		if(max < a[i]) max = a[i];
	}
	console.log(max);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());