#include <iostream>
#include <vector>
std::size_t pos1[1<<17], pos2[1<<17];
std::size_t votes[1<<17];
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::size_t n;
    std::cin>>n;
    for(std::size_t i=0;i<n;i++){
        std::size_t a;
        std::cin>>a;
        pos1[a-1]=i;
    }
    for(std::size_t i=0;i<n;i++){
        std::size_t a;
        std::cin>>a;
        pos2[a-1]=n-i;
    }
    for(std::size_t i=0;i<n;i++){
        votes[(pos1[i]+pos2[i])%n]++;
    }
    std::size_t max=0;
    for(std::size_t i=0;i<n;i++){
        if(votes[i]>max) max=votes[i];
    }
    std::cout<<max<<'\n';
    return 0;
}
