module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(e,r){e.exports=function(e){for(var r=Number(e[0]),n=e[1].split(" ").map(function(e){return Number(e)}),t=e[2].split(" ").map(function(e){return Number(e)}),o=new Array(r),u=0,i=0,f=0,l=0;l<r;l++)o[l]=n[l]-t[l],u+=o[l],o[l]<0&&(i-=o[l],f++);if(0!=f)if(u<0)console.log(-1);else{o.sort(function(e,r){return r-e});for(var c=f,a=0;a<r&&!(o[a]<=0)&&(c++,!(o[a]>i));a++)i-=o[a];console.log(c)}else console.log(0)}},function(e,r){e.exports=require("fs")}]);