import Control.Monad
main=do
 n<-readLn;s<-replicateM n getLine
 m<-readLn;t<-replicateM m getLine
 print(max 0 (maximum (map (f s t) s)))
  where f s t l = (length(filter (==l) s))-(length(filter (==l) t))