"use strict"
function Main(input) {
  input = input.trim().split('\n');
  const N = Number(input[0]);
  const S = input.slice(1,N+1);
  const M = Number(input.slice(N+1)[0]);
  const T = input.slice(N+2)

  const blue = {};
  const red = {};
  for(let i=0; i<N; i++){
    if(typeof blue[S[i]] === 'undefined'){
      blue[S[i]] = 1;
    } else {
      blue[S[i]] = blue[S[i]] + 1;
    }
  }
  for(let i=0; i<M; i++){
    if(typeof red[T[i]] === 'undefined'){
      red[T[i]] = 1;
    } else {
      red[T[i]] = red[T[i]] + 1;
    }
  }

  let ret = 0;
  for(let key in blue){
    let p = 0;
    if(red[key]){
      p = blue[key] - red[key];
    } else {
      p = blue[key];
    }
    if(ret < p) ret = p;
  }
  console.log(ret);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));