(defn input []
  (list
    (loop [n (Integer/parseInt (read-line)) Ss '()]
      (if (zero? n)
        Ss
        (recur (dec n) (cons (read-line) Ss))))
    (loop [m (Integer/parseInt (read-line)) Ts '()]
      (if (zero? m)
        Ts
        (recur (dec m) (cons (read-line) Ts))))))

(defn TwoColorsCardGame [[Ss Ts]]
  (apply max
    (cons 0
      (map -
        (map #(->> Ss (filter (partial = %)) count) (distinct Ss))
        (map #(->> Ts (filter (partial = %)) count) (distinct Ss))))))


(-> (input)
  TwoColorsCardGame
  println)