#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int a[N], b[N];
long double cnt[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      cnt[i] = 0;
    }
    for (int i = 0; i < n; i++) {
      cin >> b[i];
    }
    int k = 0, s1 = 0, s2 = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] == 0 && b[i] == 0) s1++;
      if (a[i] != 0 && b[i] == 0) s2++;
      if (b[i] != 0 && a[i] != 0)
        cnt[k++] = (long double)(a[i]) / (long double)(b[i]);
    }
    sort(cnt, cnt + k);
    if (cnt[0] == 0) {
      cout << s1 + s2 << endl;
    } else {
      int ans = 0;
      for (int i = 0; i < k; i++) {
        int cur = int(upper_bound(cnt, cnt + k, cnt[i]) - cnt);
        ans = max(ans, cur - i);
      }
      ans = max(ans + s1, s1 + s2);
      cout << ans << endl;
    }
  }
  return 0;
}
