#include <Bits/stdc++.h>
#define ll long long
using namespace std;
ll a[1000005],b[1000005],c[1000005],d[1000005],m1[1000005],m2[1000005];
ll n,h=1,j=1,k=1,l=1,kq=0;
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>>m1[i];
        if(m1[i]<0)
        {
            a[h]=abs(m1[i]);
            h++;
        }
        else
        {
            c[k]=m1[i];
            k++;
        }
    }
    for(int i=1;i<=n;i++)
    {
        cin>>m2[i];
        if(m2[i]>0)
        {
            b[j]=m2[i];
            j++;
        }
        else
        {
            d[l]=abs(m2[i]);
            l++;
        }
    }
    sort(a+1,a+h);
    sort(b+1,b+j);
    sort(c+1,c+k);
    sort(d+1,d+l);
    int tam=0;
    for(int i=1;i<j;i++)
    {
        int vt=upper_bound(a+tam+1,a+h,b[i])-a;
        tam=vt;
        if(vt<h)
            kq++;
    }
    tam=0;
    for(int i=1;i<k;i++)
    {
        int vt=upper_bound(d+tam+1,d+l,c[i])-d;
        tam=vt;
        if(vt<l)
        {
            kq++;
        }
    }
    cout<<kq;
}
