#include <stdlib.h>
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <string>
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
using namespace std;
using ll = long long;

int main(){
  int N,M;
  cin >> N;
  map<string,int> blue;
  string s;
  for(int i=0;i<N;++i){
    cin >> s;
    if(blue.count(s)) blue.at(s)++;
    else blue[s]=1;
  }
  cin >> M;
  map<string,int> red;
  for(int i=0;i<M;++i){
    cin >> s;
    if(red.count(s)) red.at(s)++;
    else red[s]=1;
  }

  int ans=-200;
  for(auto p: blue){
    auto word=p.first;
    auto value=p.second;
    if(red.count(word)){
      ans=max(ans,value-red.at(word));
    }
    else ans=max(ans,value);
  }

  if(ans<0) cout << 0 << endl;
  else cout << ans << endl;
  
  return 0;
}

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


/* エイリアス */
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace
#define mp make_pair


/* 関数マクロ */
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())


/* 定数 */
const ll mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


/* その他 */
template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;


signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  int n; cin >> n;
  map<string,int> red, blue;

  rep(i, n) {
    string s; cin >> s;
    ++red[s];
  }

  int m; cin >> m;
  rep(i, m) {
    string s; cin >> s;
    ++blue[s];
  }

  int ans = 0;
  for (auto e : red) {
    int score = e.se;
    score -= blue[e.fi];

    chmax(ans, score);
  }

  cout << ans << endl;
}
