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: ###############################################################################
  
  from sys import stdout
  from bisect import bisect_left as binl
  from copy import copy, deepcopy
  from collections import defaultdict
  
  
  mod = 1
  
  
  def intin():
      input_tuple = input().split()
      if len(input_tuple) <= 1:
          return int(input_tuple[0])
      return tuple(map(int, input_tuple))
  
  
  def intina():
      return [int(i) for i in input().split()]
  
  
  def intinl(count):
      return [intin() for _ in range(count)]
  
  
  def modadd(x, y):
      global mod
      return (x + y) % mod
  
  
  def modmlt(x, y):
      global mod
      return (x * y) % mod
  
  
  def lcm(x, y):
      while y != 0:
          z = x % y
          x = y
          y = z
      return x
  
  
  def combination(x, y):
      assert x >= y
  
      if y > x // 2:
          y = x - y
  
      ret = 1
  
      for i in range(0, y):
          j = x - i
          i = i + 1
  
          ret = ret * j
          ret = ret // i
  
      return ret
  
  
  def get_divisors(x):
      retlist = []
      for i in range(1, int(x**0.5) + 3):
          if x % i == 0:
              retlist.append(i)
              retlist.append(x // i)
      return retlist
  
  
  def get_factors(x):
      retlist = []
      for i in range(2, int(x**0.5) + 3):
          while x % i == 0:
              retlist.append(i)
              x = x // i
      retlist.append(x)
      return retlist
  
  
  def make_linklist(xylist):
      linklist = {}
      for a, b in xylist:
          linklist.setdefault(a, [])
          linklist.setdefault(b, [])
          linklist[a].append(b)
          linklist[b].append(a)
      return linklist
  
  
  def calc_longest_distance(linklist, v=1):
      distance_list = {}
      distance_count = 0
      distance = 0
      vlist_previous = []
      vlist = [v]
      nodecount = len(linklist)
  
      while distance_count < nodecount:
          vlist_next = []
          for v in vlist:
              distance_list[v] = distance
              distance_count += 1
              vlist_next.extend(linklist[v])
          distance += 1
          vlist_to_del = vlist_previous
          vlist_previous = vlist
          vlist = list(set(vlist_next) - set(vlist_to_del))
  
      max_distance = -1
      max_v = None
      for v, distance in distance_list.items():
          if distance > max_distance:
              max_distance = distance
              max_v = v
  
      return (max_distance, max_v)
  
  
  def calc_tree_diameter(linklist, v=1):
      _, u = calc_longest_distance(linklist, v)
      distance, _ = calc_longest_distance(linklist, u)
      return distance
  
  
  class UnionFind:
  
      def __init__(self, n):
          self.parent = [i for i in range(n)]
  
      def root(self, i):
          if self.parent[i] == i:
              return i
          self.parent[i] = self.root(self.parent[i])
          return self.parent[i]
  
      def unite(self, i, j):
          rooti = self.root(i)
          rootj = self.root(j)
          if rooti == rootj:
              return
          if rooti < rootj:
              self.parent[rootj] = rooti
          else:
              self.parent[rooti] = rootj
  
      def same(self, i, j):
          return self.root(i) == self.root(j)
  
  
  ###############################################################################
  
  
  def main():
      n = intin()
      slist = [input() for _ in range(n)]
      m = intin()
      tlist = [input() for _ in range(m)]
  
      counts = defaultdict(int)
      for s in slist:
          counts[s] += 1
  
      for t in tlist:
          counts[t] -= 1
  
      ans = 0
      for s, count in counts.items():
          ans = max(ans, count)
  
      print(ans)
  
  
  if __name__ == "__main__":
      main()
  
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"}]