const main = async () => {
  'use strict'
  const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim()
  
  let setting = input.split('\n')

  const setting_1 = setting[0].split(' ')
  const setting_2 = setting[1].split(' ').map( str => parseInt(str, 10) )
  const setting_3 = setting[2].split(' ').map( str => parseInt(str, 10) )

  const a_table_book = setting_1[0] - 0
  const b_table_book = setting_1[1] - 0
  let time_sum = setting_1[2] - 0


  let count = 0

  let book_arr = setting_2.concat(setting_3)
  book_arr.sort(function(a,b){
    if( a < b ) return -1;
    if( a > b ) return 1;
    return 0;
  });


  while (time_sum > 0 || book_arr.length > 0) {
    if (time_sum >= book_arr[0]) {
      time_sum -= book_arr[0]
      book_arr.shift()
      count++
    } else {
      break
    }
  }

  console.log(count)

}

main()