#include <bits/stdc++.h>
#define ll long long
#define name "DANCING"
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);if(fopen(name".INP","r")){freopen(name".INP","r",stdin);freopen(name".OUT","w",stdout);}
using namespace std;
const ll N=100000;
ll a[N+1],b[N+1],A[N+1],cnta[N+1],B[N+1],cntb[N+1],n;
ll dc(ll a[],ll sb,ll b[],ll sg,bool p){
    ll cap=0,i=0,j=0;
    while(i<sb&&j<sg){
        if((p&&a[i]<b[j])||(!p&&a[i]>b[j])){
            cap++;i++;j++;
        }
        else if(p)
            j++;
        else i++;
    }
    return cap;
}
int main(){
    fast
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    ll k1=0,k2=0,k3=0,k4=0;
    for(int i=0;i<n;i++){
        if(a[i]>0)A[k1++]=a[i];
        else cnta[k2++]=-a[i];
        if(b[i]>0)B[k3++]=b[i];
        else cntb[k4++]=-b[i];
    }
    sort(A,A+k1);sort(cnta,cnta+k2);
    sort(B,B+k3);sort(cntb,cntb+k4);
    cout<<dc(A,k1,cntb,k4,1)+dc(cnta,k2,B,k3,0);
    return 0;
}

