const p=i=>i.split(" ").map(e=>Number.parseInt(e))
const main = input => {
  const[[n,m,k],a,b]=input.trim().split("\n").map(p)
  const c=[...a,...b].sort((a,b)=>a-b)
  const l=c.length
  let r=k
  for(let i=0;i<l;i++){
    r-=c[i]
    if(r<0)return i
  }
  return l
}

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