import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  let
    merge :: [Int] -> [Int] -> [Int]
    merge [] ys = ys
    merge xs [] = xs
    merge xs@(x : xs') ys@(y : ys') | y < x     = y : merge xs ys'
                                    | otherwise = x : merge xs' ys
    go :: Int -> Int -> [Int] -> Int
    go i j (x : xs) | x <= i    = go (i - x) (j + 1) xs
    go _ j _                    = j
  [n, m, k] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  as <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  bs <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  print . go k 0 $ merge as bs

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
