/*
                    !!!!!!                                                     
                    !!!!!!!!!!                                                 
                     !!!!!!!!!!!!!!!                                           
                       !!!!!!!!!!!!!!                                          
                     !!!!!!!!!!!!!!!                                           
                      !!!!!!!!!!!!                                             
                      !!!!!!!!!!!!                                             
                        !!!!!!!!!!!!                                           
                        !!!!!!!!                                               
                        !!!!!!!!!!                                             
                       !!!!!!!!!!!!!!                                          
                     !!!!!!!!!!!!!!!!                                          
                    !!!!!!!!!!!!!!!!                                  !!!!!    
                  !!!!!!!!!!!!!!!!!!!                               !!!!!!!!!! 
                 !!!!!!!!!!!!!!!!!!!!!!!                 !         !!!!!!!!!!  
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!              !!     !!!!!!!!!!!!    
           !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!      !!!!!!!!       
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      
             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!       
              !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  !!!!!!!!!!!!       
       !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!!!!!        
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      !!!!!         
          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!!          
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !          
          !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                       
           !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                         
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                          
                 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                           
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                               
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                               
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!                                 
                  !!!!!!!!!!!!!!!!!!!!!!!!!!                                   
                  !!!!!!!!!!!!!!!!!!!!!!!!!                                    
                   !!!!!!!!!!!!!!!!!!!!!!!!                                    
                    !!!!!!!!!!!!!!!!!!!!                                       
                    !!!!!!!!!!!!!!!!!!!                                        
                     !!!!!!!!!!!!!!!!                                          
                      !!!!!!!!!!!!!!!!                                         
                      !!!!!!!!!!!!!!!                                          
                       !!!!!!!!!!!!!!                                          
                        !!!!!!!!!!!!                                           
                        !!!!!!!!!!!!                                           
                        !!!!!!!!!!!!                                           
                          !!!!!!!!                                             
                          !!!!!!                                               
                           !!!! 
*/                                               
#include <bits/stdc++.h>
#define MAXN 500005
#define mod 1000000007
using namespace std;
/*
 *  author  :  vivekcrux
 */
typedef long long ll; 
typedef pair<ll,ll> pll;

ll power(ll x,ll y,ll m=mod)
{
	ll ans = 1;
	while(y>0)
	{
		if(y&1)
		{
			ans = (ans*x)%m;
		}
		x = (x*x)%m;	
		y /= 2;
	}
	return ans%m;
}

ll modInverse(ll a, ll m=mod) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
  
    if (m == 1) 
      return 0; 
  
    while (a > 1) 
    { 
        // q is quotient 
        ll q = a / m; 
        ll t = m; 
  
        // m is remainder now, process same as 
        // Euclid's algo 
        m = a % m, a = t; 
        t = y; 
  
        // Update y and x 
        y = x - q * y; 
        x = t; 
    } 
  
    // Make x positive 
    if (x < 0) 
       x += m0; 
  
    return x; 
} 


int main()
{
// 	freopen("input.txt","r",stdin);

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll i,j,k;
	ll n;
	cin>>n;
	pll a[n+1],b[n+1];
	ll sa = 0, sb = 0;
	for(i=1;i<=n;i++)   
	{
	    cin>>a[i].first;
	    a[i].second = i;
	    sa += a[i].first;
	}
	for(i=1;i<=n;i++)   
	{
	    cin>>b[i].first;
	    b[i].second = i;
	    sb += b[i].first;
	}
	if(sa<sb)
	    cout<<"-1";
	else
	{
	    priority_queue<ll> p,q;
	    for(i=1;i<=n;i++)
	    {
	        if(a[i].first>=b[i].first)
	            p.push(a[i].first-b[i].first);
            else
	            q.push(-a[i].first+b[i].first);
	    }
	    ll ans = 0;
	    if(!q.empty())
	    {
    	    ll el = p.top();p.pop();ans++;
            ll val = q.top();q.pop();ans++;
    	    while(!q.empty())
    	    {
    	        if(el>val)
    	        {
    	            el -= val;
    	            val = q.top();
    	            q.pop();
    	            ans++;
    	        }
    	        else
    	        {
    	            val -= el;
    	            el = p.top();
    	            p.pop();
    	            ans++;
    	        }
    	    }
    	    while(val)
    	    {
    	        if(el>val)
    	        {
    	            el -= val;
    	            val = 0;
    	        }
    	        else
    	        {
    	            val -= el;
    	            el = p.top();
    	            p.pop();
    	            ans++;
    	        }
    	    }
	    }
	    cout<<ans;
	}
	
	return 0;
}


Measured memory_bytes: 4348