import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readString() -> String {
    return readLine()!
}

func readLines(times: Int) -> [String] {
    var array = [String]()
    for _ in 0..<times {
        array.append(readLine()!)
    }
    return array
}

func readSeparatedStrings() -> [String] {
    return readLine()!.split(separator: " ").map({String($0)})
}

func readStringToStrings() -> [String] {
    return readLine()!.map({String($0)})
}

func readSeparatedInts() -> [Int] {
    return readLine()!.split(separator: " ").map({Int($0)!})
}
func readSeparatedDouble() -> [Double] {
    return readLine()!.split(separator: " ").map({Double($0)!})
}

let nmk = readSeparatedInts()
let n = nmk[0]
let m = nmk[1]
var k = nmk[2]

var As = readSeparatedInts()
var Bs = readSeparatedInts()

var books = (As + Bs).sorted()

var count: Int = 0
var totalPage: Int = 0

if books.first! > k {
    print(0)
} else {
    while (true) {
        if books.isEmpty {
            break
        } else if( k - books.first!) < 0  {
            break
        } else {
            k -= books.first!
            books.remove(at: 0)
        }
        count += 1
    }
    print(count)
}

