#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1000 * 100 + 123;
int _gcd(int a, int b) {
  if (b == 0) return a;
  return _gcd(b, a % b);
}
int gcd(int a, int b) { return _gcd(a > 0 ? a : -a, b > 0 ? b : -b); }
int n, a[maxn], b[maxn], zero;
map<pair<int, int>, int> ds;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", b + i);
    if (!a[i] & !b[i]) zero++;
  }
  for (int i = 0; i < n; ++i) {
    if (a[i]) {
      int g = gcd(a[i], b[i]);
      if (a[i] < 0) {
        a[i] *= -1;
        b[i] *= -1;
      }
      ds[make_pair(-b[i] / g, a[i] / g)]++;
    }
  }
  int res = zero;
  for (auto& i : ds) {
    res = max(res, i.second + zero);
  }
  printf("%d", res);
  return 0;
}
