#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, MxN = 2e5, M = 0, ctr = 0;
  long long a[MxN], b[MxN];
  map<long double, long long> m;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  long double d;
  for (int i = 0; i < n; i++) {
    if ((!a[i])) {
      if (!b[i])
        ctr++;
      else
        ;
    } else {
      d = (long double)b[i] / a[i];
      m[d]++;
    }
  }
  for (auto &x : m) {
    M = max(M, x.second);
  }
  M += ctr;
  cout << M << "\n";
  return 0;
}
