#include <bits/stdc++.h>
using namespace std;
map<long double, long long> crp;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long double a[n + 1], b[n + 1], mn, mx;
  for (int k = 1; k <= n; k++) cin >> a[k];
  long long ans = 0, cnt = 0, j = 0;
  for (int k = 1; k <= n; k++) {
    cin >> b[k];
    if (a[k] == 0 && b[k] == 0)
      ans++;
    else {
      if (a[k] != 0) {
        long double x = -(b[k] / a[k]);
        crp[x]++;
        cnt = max(cnt, crp[x]);
      }
    }
  }
  cout << ans + cnt;
  return 0;
}
