import Data.List py :: [Int] -> [Int] -> Int py ws bs = max (iter 0 (head ws)) (iter 1 (head bs)) where iter i n | null l = 1 | otherwise = 1 + iter (1-i) (head l) where l | i == 0 = filter (>n) bs | otherwise = filter (>n) ws main = do getLine ws <- sort . map read . words <$> getLine getLine bs <- sort . map read . words <$> getLine print $ py ws bs