output_description: If Takahashi can earn at most X yen on balance, print X.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      s_1
      s_2
      :
      s_N
      M
      t_1
      t_2
      :
      t_M
attempt: 
  #include <iostream>
  #include <iomanip>
  #include <string>
  #include <sstream>
  #include <bitset>
  #include <algorithm>
  #include <cmath>
  #include <numeric>
  #include <utility>
  #include <set>
  #include <map>
  #include <tuple> 
  #include <vector>
  #include <stack>
  #include <queue>
  #include <deque>
  #include <list>
  using namespace  std;
  using ll = long long;
  using P = pair<ll, ll>;
  #define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
  #define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
  #define ALL(a) (a).begin(),(a).end()
  #define RALL(a) (a).rbegin(), (a).rend()
  template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
  { return s << '<' << P.first << ", " << P.second << '>'; }
  template<class T> ostream& operator << (ostream &s, vector<T> P)
  { for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
  template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
  { for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
  const long long MOD = static_cast<long long>(1e9) + 7LL;
  const long long INF = 1234567891234567890LL;
  int main(){
      cin.tie(0);
      cout.sync_with_stdio(false);
      int N; cin >> N;
      map<string, int> m;
      string s;
      REP(i, N) {
          cin >> s;
          m[s] += 1;
      }
      int M; cin >> M;
      REP(i, M){
          cin >> s;
          if(m.count(s)) m[s] -= 1;
      }
      int mx = 0;
      for(auto p: m){
          mx = max(mx, p.second);     
      }
      cout << mx << endl;
      return 0;
  }
  
problem_description: Statement
  
  Takahashi has N blue cards and M red cards. A string is written on each card.
  The string written on the i-th blue card is s_i, and the string written on the
  i-th red card is t_i.
  
  Takahashi will now announce a string, and then check every card. Each time he
  finds a blue card with the string announced by him, he will earn 1 yen (the
  currency of Japan); each time he finds a red card with that string, he will
  lose 1 yen.
  
  Here, we only consider the case where the string announced by Takahashi and
  the string on the card are exactly the same. For example, if he announces
  `atcoder`, he will not earn money even if there are blue cards with
  `atcoderr`, `atcode`, `btcoder`, and so on. (On the other hand, he will not
  lose money even if there are red cards with such strings, either.)
  
  At most how much can he earn on balance?
  
  Note that the same string may be written on multiple cards.
samples: [{"input": "3\n    apple\n    orange\n    apple\n    1\n    grape", "output": "2\n    \n\nHe can earn 2 yen by announcing `apple`.\n\n* * *"}, {"input": "3\n    apple\n    orange\n    apple\n    5\n    apple\n    apple\n    apple\n    apple\n    apple", "output": "1\n    \n\nIf he announces `apple`, he will lose 3 yen. If he announces `orange`, he can\nearn 1 yen.\n\n* * *"}, {"input": "1\n    voldemort\n    10\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort\n    voldemort", "output": "0\n    \n\nIf he announces `voldemort`, he will lose 9 yen. If he announces `orange`, for\nexample, he can avoid losing a yen.\n\n* * *"}, {"input": "6\n    red\n    red\n    blue\n    yellow\n    yellow\n    red\n    5\n    red\n    red\n    yellow\n    green\n    blue", "output": "1"}]