process.stdin.resume();
process.stdin.setEncoding('utf8');
// 自分の得意な言語で
// Let's チャレンジ！！

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const [N,M,K] = lines[0].split(" ").map(v=>v-0);
  const alist = lines[1].split(" ").map(v=>v-0);
  const blist = lines[2].split(" ").map(v=>v-0);
  const list = alist.concat(blist).sort((a,b)=>a-b);
  let ans = 0;
  let sum = 0;
  for(let i=0;i<list.length;i++){
      sum+=list[i];
      if(sum>K) break;
      ans++;
  }
  console.log(ans);
});
