#include <bits/stdc++.h>
using namespace std;
#define TLHAdepzais1tg ios_base::sync_with_stdio(0);cin.tie();cout.tie(0);
#define N 1000005
int n;
int a[N],b[N],c[N],d[N],m[N],w[N];
int h=1,j=1,k=1,l=1,kq=0;
int main()
{
    TLHAdepzais1tg;
    if(fopen("dancing.inp","r"))
    {
        freopen("dancing.inp","r",stdin);
        freopen("dancing.out","w",stdout);
    }
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>m[i];
        if(m[i]<0)
        {
            a[h]=abs(m[i]);
            h++;
        }
        else
        {
            c[k]=m[i];
            k++;
        }
    }
    for(int i=1;i<=n;i++)
    {
        cin>>w[i];
        if(w[i]>0)
        {
            b[j]=w[i];
            j++;
        }
        else
        {
            d[l]=abs(w[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;
    return 0;
}
