#include <bits/stdc++.h>
std::string n[100], m[100];
int a, b, count, max = 0;
int main() {
  std::cin >> a;
  for (int i = 1; i <= a; i++) std::cin >> n[i];
  std::cin >> b;
  for (int i = 1; i <= b; i++) std::cin >> m[i];
  for (int i = 1; i <= a; i++) {
    count = 0;
    for (int j = 1; j <= a; j++) {
      if (n[i] == n[j]) {
        count++;
      }
    }
    for (int j = 1; j <= b; j++) {
      if (n[i] == m[j]) {
        count--;
      }
    }
    if (max < count) {
      max = count;
    }
  }
  std::cout << max << std::endl;
}
