import Data.List

readIntList :: IO [Int]
readIntList = map read . words <$> getLine

f :: [Int] -> Int -> Int -> Int -> Int
f (x:xs) count sumTime limit
    | sumTime + x < limit = f xs (count + 1) (sumTime + x) limit
    | sumTime + x == limit = count + 1
    | otherwise = count
f [] count sumTime limit = count



main = do
    [_, _, k] <- readIntList
    a <- readIntList
    b <- readIntList
    let ab = sort (a ++ b) :: [Int]
    let ret = f ab 0 0 k
    print ret