#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<long double> a(n), b(n);
    map<long double, long long> m;
    m.clear();
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> b[i];
    long long c = 0;
    for (int i = 0; i < n; ++i) {
      if (a[i] == 0 && b[i] != 0) continue;
      if (a[i] == 0 && b[i] == 0) {
        ++c;
        continue;
      }
      long double val = b[i] / a[i];
      m[val]++;
    }
    long long cnt = 0;
    for (auto i = m.begin(); i != m.end(); ++i) {
      cnt = max(cnt, i->second);
    }
    cout << cnt + c << '\n';
  }
  return 0;
}
