#include<bits/stdc++.h>
using namespace std;
long long n,a[1010],b[1010],ans;
int main(){
freopen("proposal.in","r",stdin);
freopen("proposal.out","w",stdout);
cin>>n;
for(long long i=1;i<=n;i++)
cin>>a[i];
for(long long i=1;i<=n;i++)
cin>>b[i];
b[n+1]=1000000007;
for(long long i=1;i<=n;i++){
if(a[i]>b[i]){
long long res=1,j=i+1;
while(a[i]>b[j]){
j++;
res++;
}
ans=max(ans,res);
}
}
cout<<ans;
return 0;
}