#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
	int N;
	cin >> N;
	vector<ll> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < N; i++) {
		ll B;
		cin >> B;
		A[i] -= B;
	}
	if (accumulate(A.begin(), A.end(), 0LL) < 0) {
		cout << -1 << endl;
		return 0;
	}
	ll sum = 0;
	sort(A.begin(), A.end());
	int t = 0;
	while (t < N && A[t] < 0) sum += A[t++];
	if (sum >= 0) {
		cout << 0 << endl;
		return 0;
	}
	reverse(A.begin() + t, A.end());
	for (int i = t; i < N; i++) {
		sum += A[i];
		if (sum >= 0) {
			cout << i + 1 << endl;
			break;
		}
	}
	return 0;
}
