#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, extra = 0;
  cin >> n;
  vector<long double> a(n);
  map<long double, int> m;
  long double x, y;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> y;
    if (!y && !a[i])
      extra++;
    else if (y && !a[i])
      continue;
    else if (a[i] && !y)
      m[0]++;
    else {
      x = (-1.0 * y) / a[i];
      m[x]++;
    }
  }
  int ans = 0;
  for (auto p : m) ans = max(ans, p.second);
  cout << ans + extra << "\n";
  return 0;
}
