import Foundation

private func readWords<T>(_ f: (Substring) -> T) -> [T] {
    return readLine()!.split(separator: " ").map(f)
}

prefix operator *
private prefix func *<T>(a: inout IndexingIterator<[T]>) -> T {
    return a.next()!
}

func mainC() {
    var nmk = readWords { Int($0)! }.makeIterator()
    let n = *nmk
    let m = *nmk
    var k = *nmk
    
    var A = readWords { Int($0)! }.sorted(by: >)
    var B = readWords { Int($0)! }.sorted(by: >)
    
    var ans = 0
    while true {
        let a = A.popLast()
        let b = B.popLast()
        
        if let a = a, let b = b {
            if a > b {
                A.append(a)
                k -= b
                if k < 0 {
                    break
                } else {
                    ans += 1
                }
            } else {
                B.append(b)
                k -= a
                if k < 0 {
                    break
                } else {
                    ans += 1
                }
            }
        } else if let a = a {
            k -= a
            if k < 0 {
                break
            } else {
                ans += 1
            }
        } else if let b = b {
            k -= b
            if k < 0 {
                break
            } else {
                ans += 1
            }
        } else {
            break
        }
    }
    
    print(ans)
}

mainC()
