#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
string drob(long long a, long long b) {
  long long GCD = gcd(a, b);
  return to_string(a / GCD) + ':' + to_string(b / GCD);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<string, long long> m;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  long long all_go = 0;
  for (long long i = 0; i < n; ++i) {
    long long b;
    cin >> b;
    if (b == 0) {
      if (a[i] != 0)
        ++m[drob(0, 1)];
      else
        ++all_go;
    }
    if (a[i] != 0) ++m[drob(a[i], b)];
  }
  long long ans = 0;
  for (auto i : m) ans = max(ans, i.second);
  ans += all_go;
  cout << ans;
  return 0;
}
