#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long double a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  map<long double, long long> m;
  long long temp = 0, c = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) {
      if (b[i] != 0) {
        long double p = (-1 * b[i]) / a[i];
        m[p]++;
      } else
        m[0]++;
    } else {
      if (b[i] == 0) c++;
    }
  }
  for (auto i = m.begin(); i != m.end(); i++) {
    long long p = i->second;
    temp = max(temp, p);
  }
  cout << temp + c << endl;
}
