#include <bits/stdc++.h>
#define ll long long
#define N 100003
#define ok "DANCING"
#define fi first
#define se second
#define pb push_back
#define pii pair <int,int>
#define mp make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define name if (fopen(ok".INP","r")){ freopen(ok".INP","r",stdin); freopen(ok".OUT","w",stdout);}
using namespace std;
int n,a[N],b[N],c[N],d[N],x[N],y[N];
int j=1,k=1,h=1,l=1,ans=0;
int main()
{
    fast name
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>x[i];
        if (x[i]<0)a[h++]=abs(x[i]);
        else c[k++]=x[i];
    }
    for (int i=1;i<=n;i++)
    {
        cin>>y[i];
        if (y[i]<0) d[l++]=abs(y[i]);
        else b[j++]=y[i];
    }
    sort(c+1,c+k);
    sort(a+1,a+h);
    sort(b+1,b+j);
    sort(d+1,d+l);
    int tg=0;
    for (int i=1;i<j;i++)
    {
        int t=upper_bound(a+tg+1,a+h,b[i])-a;
        tg=t;
        if (t<h) ans++;
    }
    tg=0;
    for (int i=1;i<k;i++)
    {
        int t=upper_bound(d+tg+1,d+l,c[i])-d;
        tg=t;
        if (t<l) ans++;
    }
    cout<<ans;
    return 0;
}
