program ABC_091_B_TwoColorsCardGame
   implicit none
   integer N, M, i, j
   character(10), allocatable :: s(:), t(:)
   integer, allocatable :: counts(:)
   read(*, *) N
   do i = 1, N
      read(*, *) s(i)
   end do
   read(*, *) M
   do i = 1, M
      read(*, *) t(i)
   end do
   allocate (s(1: N))
   allocate (t(1: N))
   allocate (counts(1: N))
   counts(:) = 0
   do j = 1, N
       do i = 1, N
          if(s(j) == s(i)) then
	      counts(j) = counts(j) + 1
		  end if
	   end do
	   do i = 1, M
          if(s(j) == t(i)) then
	      counts(j) = counts(j) - 1
		  end if
	   end do
   end do
   write(*, *) maxval(counts)
end program ABC_091_B_TwoColorsCardGame 