import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Foldable
import           Data.Maybe
import qualified Data.Sequence         as Seq

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  n <- getInt
  as <- getIntList
  bs <- getIntList

  let countAB [] [] ps nneg dneg total = (ps, nneg, dneg, total)
      countAB (a:as') (b:bs') ps nneg dneg total | a < b     = countAB as' bs' ps (nneg+1) (dneg+b-a) (total+a-b)
                                                 | otherwise = countAB as' bs' ((a-b):ps) nneg dneg (total+a-b)

      (ps, nneg, dneg, total) = countAB as bs [] 0 0 0

      ps' = toList $ Seq.unstableSortBy (flip compare) $ Seq.fromList ps

      takePs ps dneg m | dneg <= 0 = m
                       | otherwise = let (p:ps') = ps
                                         dneg' = dneg - p
                                     in takePs ps' dneg' (m+1)

      ans = if total < 0 then -1 else nneg + takePs ps' dneg 0

  print ans