import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(long[] a, long[] b) {
    int n = cast(int) a.length;
    long[] pos, neg;
    for (int i = 0; i < n; i++) {
        if (a[i] > b[i]) pos ~= a[i] - b[i];
        else if (a[i] < b[i]) neg ~= b[i] - a[i];
    }

    if (pos.sum < neg.sum) return -1;

    pos.sort!((x, y) => x > y);
    neg.sort();

    auto pos2 = pos.dup;

    int ans = cast(int) neg.length;
    int p = 0;
    for (int i = 0; i < neg.length; i++) {
        long x = neg[i];
        while (p < pos.length) {
            long t = min(x, pos[p]);
            x -= t;
            pos[p] -= t;
            if (pos[p] == 0) {
                p++;
            }
            if (x == 0) break;
        }
        if (x > 0) return -1;
    }

    for (int i = 0; i < pos2.length; i++) {
        if (pos[i] != pos2[i]) ans++;
    }
    return ans;
}

void main() {
    readint;
    auto a = reads!long;
    auto b = reads!long;
    writeln(calc(a, b));
}
