/*
   _________   _________     ______    _________     ______     ______     _________   _________   _________
       |       |            /      \       |        /      \    |     \    |               |       |        
       |       |           /               |       /        \   |     |    |               |       |        
       |       |________   |               |       |        |   |_____/    |________       |       |________
       |       |           |               |       |        |   |     \    |               |       |        
       |       |           \               |       \        /   |      \   |               |       |        
       |       |________    \______/       |        \______/    |______/   |________       |       |________


     ______       __                  _________   ___        _______
    /      \     /  \                     |         |        |     |   |     /|
   /            /    \                    |         |        |     |   |    / |
   |           /______\                   |         |____    |     |   |   /  |
   |           |      |                   |         |    \   |     |   |  /   |
   \           |      |                   |         |     \  |     |   | /    |
    \______/   |      |                   |         |_____/  |     |   |/     |


*/
#include <iostream>
#include <vector>
std::vector<std::size_t> pos1[1<<17], pos2[1<<17];
std::size_t votes[1<<17];
int main(){
    /*
       O(n^2)
           1 1 ..... 1 1
           1 1 ..... 1 1
    */
    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].push_back(i);
    }
    for(std::size_t i=0;i<n;i++){
        std::size_t a;
        std::cin>>a;
        pos2[a-1].push_back(n-i);
    }
    for(std::size_t i=0;i<n;i++){
        for(std::size_t a=0;a<pos1[i].size();a++){
            for(std::size_t b=0;b<pos2[i].size();b++){
                votes[(pos1[i][a]+pos2[i][b])%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;
}
