#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
map<pair<int, int>, int> num;
int n, add, num0, a[maxn], b[maxn];
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 0 && b[i] != 0) continue;
    if (a[i] == 0 && b[i] == 0) ++add;
    if (a[i] != 0) {
      if (b[i] == 0) {
        pair<int, int> x = make_pair(0, 0);
        ++num[x];
      } else {
        int g = gcd(abs(a[i]), abs(b[i]));
        int cur = 1ll * a[i] * b[i] < 0ll ? 1 : -1;
        a[i] /= g;
        b[i] /= g;
        pair<int, int> x = make_pair(abs(a[i]) * cur, abs(b[i]));
        ++num[x];
      }
    }
  }
  int ans = 0;
  for (map<pair<int, int>, int>::iterator iter = num.begin(); iter != num.end();
       ++iter)
    ans = max(ans, iter->second);
  printf("%d\n", ans + add);
  return 0;
}
