"use strict";

var print = function print(x) {
  return console.log(x);
};

var readline = require('readline');

var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
var A, B, C;

function solve(A, B, C) {
  if (A + B >= C) return true;
  return false;
}

var lines = [];
rl.on('line', function (line) {
  lines.push(line);
});
rl.on('close', function (line) {
  var i = 0;
  var N = parseInt(lines[i++]);
  var S = {};

  for (var j = 0; j < N; ++j) {
    var v = lines[i++];
    S[v] = (S[v] || 0) + 1;
  }

  var M = parseInt(lines[i++]);
  var T = {};

  for (var _j = 0; _j < M; ++_j) {
    var _v = lines[i++];
    T[_v] = (T[_v] || 0) + 1;
  }

  var keys = {};
  Object.keys(S).forEach(function (v) {
    return keys[v] = true;
  });
  Object.keys(T).forEach(function (v) {
    return keys[v] = true;
  });
  var ret = Math.max(...Object.keys(keys).map(function (k) {
    return (S[k] || 0) - (T[k] || 0);
  }));
  console.log(ret);
});
