#include <bits/stdc++.h>
using namespace std;
int n,b,a[100004],nuc[100005],nut[100005],n1=0,n2=0,ans=0,k=1;
bool cmp(int x,int y)
{
    return abs(x)<abs(y);
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    freopen("DANCING.INP","r",stdin);
    freopen("DANCING.OUT","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=1;i<=n;i++)
    {
        cin>>b;
        if(b<0)
        {
            n1++;
            nuc[n1]=abs(b);
        }
        else
        {
            n2++;
            nut[n2]=abs(b);
        }
    }
    sort(a+1,a+n+1,cmp);
    sort(nuc+1,nuc+n1+1);
    sort(nut+1,nut+n2+1);
    for(int i=1;i<=n;i++)
    {
        if(a[i]<0)
        {
            int p=lower_bound(nut+k,nut+n2+1,abs(a[i]))-nut;
            if(p!=1)
                {
                    ans++;
                    k=p;
                }
        }
        else
        {
            int p=upper_bound(nuc+k,nuc+n1+1,abs(a[i]))-nuc;
            if(p!=n1+1)
                {
                    ans++;
                    k=p+1;
                }
        }
    }
    cout<<ans;
    return 0;
}
