"use strict";
let main = (input) => {
    let usrInput = input.split(/\n/)
    let sample = usrInput[0].split(/\s*/).map(Number)
    let bookA = usrInput[1].split(/\s*/).map(Number)
    let bookB = usrInput[2].split(/\s*/).map(Number)

    let sort = function (arr) {
        if (arr.length <= 1) { return arr; }
        let pivotIndex = Math.floor(arr.length / 2)
        let pivot = arr.splice(pivotIndex, 1)[0]
        let left = []
        let right = []
        for (let i = 0; i < arr.length; i++) {
            if (arr[i] < pivot) {
                left.push(arr[i])
            } else {
                right.push(arr[i])
            }
        }
        return quickSort(left).concat([pivot], quickSort(right))
    }

    let sumBook = bookA.concat(bookB)
    sumBook = sort(sumBook)

    let timeA = 0
    for (let index = 0; timeA < sample[2]; index++) {
        timeA += sumBook[index]
    }

    console.log(timeA)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))