import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	int n = read.to!int;
	
	long[] as;
	foreach(i; 0 .. n) as ~= read.to!long;
	debug writeln("as: ", as);
	
	long[] bs;
	foreach(i; 0 .. n) bs ~= read.to!long;
	debug writeln("bs: ", bs);
	
	long[] xs;
	long amount;
	int count;
	foreach(i; 0 .. n){
		if(bs[i] == as[i]) continue;
		if(bs[i] > as[i]) count += 1, amount += bs[i] - as[i];
		if(bs[i] < as[i]) xs ~= as[i] - bs[i];
	}
	debug writeln("xs: ", xs);
	
	for(int k = 0; k < xs.length && amount > 0; k ++){
		count += 1;
		amount -= xs[k];
	}
	if(amount > 0) count = -1;
	
	count.writeln;
}
