#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n;
  cin >> n;
  vector<string> s(0);
  vector<int> p(0);
  rep(i, n) {
    string si;
    cin >> si;
    bool hit = false;
    rep(j, s.size()) {
      if (s.at(j) == si) {
        p.at(j)++;
        hit = true;
        break;
      }
    }
    if (!hit) {
      s.push_back(si);
      p.push_back(1);
    }
  }
  cin >> n;
  rep(i, n) {
    string si;
    cin >> si;
    rep(j, s.size()) {
      if (s.at(j) == si) {
        p.at(j)--;
        break;
      }
    }
  }
  int max = 0;
  rep(j, s.size()) if (p.at(j) > max) max = p.at(j);
  cout << max << endl;
}

#include <bits/stdc++.h>
using namespace std;

template <class t>
using vc = vector<t>;
template <class t>
using vvc = vector<vector<t>>;
typedef long long ll;
typedef vc<int> vi;
typedef vvc<int> vvi;
typedef pair<int, int> pi;

#define uset unordered_set
#define umap unordered_map

#define endl "\n"

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()

#define all(a) a.bg, a.ed

template <class t, class u>
ostream &operator<<(ostream &os, const pair<t, u> &p) {
    return os << "( " << p.first << ", " << p.second << " )";
}

template <class t>
ostream &operator<<(ostream &os, const vc<t> &v) {
    os << "[ ";
    for (int i = 0; i < v.size(); i++) {
        os << v[i];
        if (i != v.size() - 1) {
            os << ", ";
        }
    }
    return os << " ]";
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    // cout << fixed << setprecision(18);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // Solution

    long long n, m;
    cin >> n;
    umap<string, long long> points;
    string temp;
    for (int i = 1; i <= n; i++) {
        cin >> temp;
        points[temp]++;
    }
    cin >> m;
    for (int i = 1; i <= m; i++) {
        cin >> temp;
        points[temp]--;
    }
    long long best_point = 0;
    for (auto &p : points) {
        best_point = max(best_point, p.second);
    }
    cout << best_point;
}
