//
//  main.swift
//  TestSpace for AtCoder
//
//  Created by Koichi Okai on 2020/06/25.
//  Copyright © 2020 Koichi Okai. All rights reserved.
//

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

func main() {
    let nmk = readInts()
    
    let A = readInts()
    let B = readInts()

    let books = ( A + B ).sorted(by: <)
    
    var count = 0
    var time = 0
    for t in books {
        time += t
        if time > nmk[2] { break }
        count += 1
    }
    print(count)
}

main()
