// C - Exam and Wizard
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
int in(){int x;scanf("%d",&x);return x;}

int main(){
	int ans = 0, N = in(), C[N];
	long long minus = 0, impossible = 0;// <0: impossible

	rp(i, 0, N) impossible += C[i] = in();

	rp(i, 0, N){
		int b = in();
		impossible -= b;
		if(impossible < 0){ puts("-1"); return 0; }
		C[i] -= b;
		if(C[i] < 0){
			ans++;//変更が必要
			minus += C[i];
		}
	}

	sort(C, C+N);
	reverse(C, C+N);

	for(int c:C){
		if(minus >= 0) break;
		if(c <= 0) break;
		ans++;//変更が必要
		minus += c;
	}

	printf("%d\n",ans);
}