#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;

int main(){

  int N, M;
  cin >> N;
  vector<string> vec1(N);
  for (int i=0; i<N; i++){
    cin >> vec1.at(i);
  }
  cin >> M;
  vector<string> vec2(M);
  for (int i=0; i<M; i++){
    cin >> vec2.at(i);
  }

  int max=0;
  for (int i=0; i<N; i++){
    int sum=0;
    for (int j=0; j<N; j++){
      if (vec1.at(i)==vec1.at(j)){
        sum++;
      }
    }
    for (int k=0; k<M; k++){
      if (vec1.at(i)==vec2.at(k)){
        sum--;
      }
    }
    if (sum>max){
      swap(sum, max);
    }
  }

  cout << max << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const int INF = 2e9;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  string a, b, c;
  cin >> a >> b >> c;
  ll ans = 0;
  rep(i,n){
    if(a[i]==b[i]&&b[i]==c[i]){
      continue;
    }
    else if(a[i]!=b[i]&&b[i]!=c[i]&&c[i]!=a[i]){
      ans += 2;
    }
    else{
      ans++;
    }
  }
  print(ans);
}