#include <bits/stdc++.h>
using namespace std;
long double A[200005], B[200005];
map<long double, int> m;
int main() {
  int n, ans = 0.0, addic = 0.0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%Lf", &A[i]);
  for (int i = 0; i < n; ++i) scanf("%Lf", &B[i]);
  for (int i = 0; i < n; ++i) {
    if (A[i] == .0) {
      if (B[i] == .0) ++addic;
      continue;
    }
    ++m[B[i] / A[i]];
  }
  for (auto i : m) ans = max(ans, i.second);
  printf("%d\n", ans + addic);
  return 0;
}
