#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
double long a[2000001], b[200001];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  map<double long, long long> x;
  long long ans = 0, ex = 0;
  for (long long i = 0; i < n; i++) {
    double long q = -b[i];
    q /= a[i];
    if (a[i] == 0) {
      if (b[i] == 0) ex++;
      continue;
    }
    x[q]++;
    ans = max(ans, x[q]);
  }
  cout << ans + ex;
  return 0;
}
