#include <bits/stdc++.h>
typedef struct {
  char str[10];
  int counta;
} AtCoderB;
int main(void) {
  int num, con = 0, i = 2, j = 0;
  char str[10];
  AtCoderB *atcoderb = (AtCoderB *)malloc(sizeof(AtCoderB));
  for (; i; i--) {
    scanf("%d", &num);
    for (; num; num--) {
      scanf("%s", str);
      for (j = 0; j < con; j++) {
        if (!strcmp(str, atcoderb[j].str)) {
          i == 2 ? atcoderb[j].counta++ : atcoderb[j].counta--;
          break;
        }
      }
      if (j == con) {
        atcoderb = (AtCoderB *)realloc(atcoderb, sizeof(AtCoderB) * ++con);
        strcpy(atcoderb[con - 1].str, str);
        atcoderb[con - 1].counta = i == 2 ? 1 : -1;
      }
    }
  }
  for (j = 0; j < con; j++) {
    num = atcoderb[j].counta > num ? atcoderb[j].counta : num;
  }
  printf("%d\n", num);
  return 0;
}
