import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.numeric;


void main()
{
  auto n = readln.chomp.to!int;
  auto d = readln.chomp.split.to!(long[]);
  auto b = readln.chomp.split.to!(long[]);
  foreach (i; 0..n) {
    d[i] -= b[i];
  }
  d = sort(d).array;

  if (d.sum < 0) {
    writeln("-1");
    return;
  }
  

  auto l = 0;
  auto r = d.length - 1;
  auto tmp = 0;
  int cnt;
  while (d[l] < 0) {
    tmp += d[l];
    while (tmp < 0) {
      tmp += d[r];
      cnt++;
      r--;
    }
    cnt++;
    l++;
  }
  cnt.writeln;
}
