#include <bits/stdc++.h>
using namespace std;
long long modularExponentiation(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x);
    x = (x * x);
    n = n / 2;
  }
  return result;
}
void solve() {
  long long n;
  cin >> n;
  long double a[n], b[n];
  map<long double, long long> dp;
  map<long double, long long>::iterator itr;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  long long c = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0)
      c++;
    else if (a[i] == 0)
      continue;
    else {
      long double g = ((-1 * b[i]) / (a[i] * 1.0));
      dp[g]++;
    }
  }
  long long ans = c;
  for (itr = dp.begin(); itr != dp.end(); itr++) {
    ans = max(ans, itr->second + c);
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  while (TESTS--) solve();
}
