const input = require("fs").readFileSync("/dev/stdin", "utf8")

;(input => {

    const lines = input.split('\n')
    const [N, M, K] = lines[0].split(' ').map(Number)
    const books = [
        ...lines[1].split(' ').map(Number),
        ...lines[2].split(' ').map(Number)
    ]
    books.sort((a, b) => a - b)

    let t = 0
    for (var i = 0; i < books.length; i++) {
        t += books[i]
        if (t > K) {
            break
        }
    }

    console.log(i)

})(input)
