#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < (int)n; i++) cin >> s.at(i);
  cin >> m;
  vector<string> t(m);
  for (int i = 0; i < (int)m; i++) cin >> t.at(i);
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  int yen1 = 0;
  string key1 = s.at(0);
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) == key1) yen1++;
  for (int i = 0; i < (int)m; i++)
    if (t.at(i) == key1) yen1--;
  int yen2 = 0;
  string key2;
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) != key1) key2 = s.at(i);
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) == key2) yen2++;
  for (int i = 0; i < (int)m; i++)
    if (t.at(i) == key2) yen2--;
  int yen3 = 0;
  string key3;
  for (int i = 0; i < (int)n; i++)
    if ((s.at(i) != key1) && (s.at(i) != key2)) key3 = s.at(i);
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) == key3) yen3++;
  for (int i = 0; i < (int)m; i++)
    if (t.at(i) == key3) yen3--;
  int yen4 = 0;
  string key4;
  for (int i = 0; i < (int)n; i++) {
    if ((s.at(i) != key1) && (s.at(i) != key2) && (s.at(i) != key3)) {
      key4 = s.at(i);
    }
  }
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) == key4) yen4++;
  for (int i = 0; i < (int)m; i++)
    if (t.at(i) == key4) yen4--;
  int yen5 = 0;
  string key5;
  for (int i = 0; i < (int)n; i++) {
    if ((s.at(i) != key1) && (s.at(i) != key2) && (s.at(i) != key3) &&
        (s.at(i) != key4)) {
      key5 = s.at(i);
    }
  }
  for (int i = 0; i < (int)n; i++)
    if (s.at(i) == key5) yen5++;
  for (int i = 0; i < (int)m; i++)
    if (t.at(i) == key5) yen5--;
  int maxi4 = max(yen4, yen5);
  int maxi3 = max(yen3, maxi4);
  int maxi2 = max(yen2, maxi3);
  int maxi1 = max(yen1, maxi2);
  cout << maxi1 << endl;
  return 0;
}
