#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int>> a(n), b(n);
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    a[i] = make_pair(d, i + 1);
  }
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    b[i] = make_pair(d, i + 1);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  unordered_map<int, int> m;
  for (int i = 0; i < n; i++) {
    int d = a[i].second - b[i].second;
    if (d > 0) d = d - n;
    m[d]++;
  }
  int ans = INT_MIN;
  for (auto i : m) {
    ans = max(ans, i.second);
  }
  cout << ans << endl;
  return;
}
int main() {
  solve();
  return 0;
}
