#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k = 0, k1 = 0;
  cin >> n;
  long double A[n], B[n], d;
  map<long double, int> M;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> B[i];
    d = -1 * (B[i] / A[i]);
    if (A[i] != 0) {
      M[d]++;
      k = max(k, M[d]);
    }
    if (A[i] == 0 && B[i] == 0) {
      k1++;
    }
  }
  cout << k + k1;
  return 0;
}
