#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, e, l, n;
  l = e = 0;
  cin >> n;
  map<long double, int> m;
  long double a[n], b[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  for (i = 0; i < n; i++) {
    if (b[i] == 0 && a[i] == 0)
      e++;
    else if (a[i] != 0)
      m[-b[i] / a[i]]++;
  }
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it == m.begin())
      l = m[it->first];
    else
      l = max(l, m[it->first]);
  }
  cout << l + e;
  return 0;
}
