n = gets.to_i
a_list = gets.split(" ").map{|s| s.to_i}
b_list = gets.split(" ").map{|s| s.to_i}

if a_list.reduce(:+) < b_list.reduce(:+) then
  puts(-1)
  exit
end

a_minux_b_list = a_list.zip(b_list).map { |ab|
  ab[0] - ab[1]
}

enough_amount_list, not_enough_amount_list =
  a_minux_b_list
    .select{|amount| amount != 0 }
    .partition{ |amount| amount > 0 }
    .map{ |list| list.sort.reverse }

if not_enough_amount_list.size == 0 then
  puts(0)
  exit
end

current_enough_amount_list_index = 0;
current_enough_amount_remaining = enough_amount_list[0];

not_enough_amount_list.each { |amount|
  rest_of_amount = amount

  loop do
    if(current_enough_amount_remaining > rest_of_amount.abs) then
      current_enough_amount_remaining += amount
      break;
    else
      rest_of_amount = (current_enough_amount_remaining + amount)
      current_enough_amount_list_index += 1
      current_enough_amount_remaining = enough_amount_list[current_enough_amount_list_index]
    end
  end
}

min_alter_operation_count = not_enough_amount_list.size + (current_enough_amount_list_index + 1)
puts min_alter_operation_count


# 方針: Ai - Bi がマイナスになるようなiについて、Ai - Bi がプラスになるようなiから点数を融通する
# Ai - Bi の余剰が多い方から順番に融通元にすると融通元になる回数を最小にすることができるはず

# memo: Array.sumが入ったのはRuby2.4からなので [1,2,3].inject(:+) とか書く必要がある
# memo: filterという名前のメソッドはない(rubyだとselect)
