#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, MOD = 1e9 + 7;
int a[N], b[N], n;
map<pair<int, int>, int> me;
int cnt = 0;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int val = 0;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> b[i];
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 0 && b[i] == 0) {
      ++cnt;
      continue;
    }
    if (b[i] == 0) {
      ++val;
      continue;
    }
    if (a[i] == 0) {
      continue;
    }
    int g = gcd(a[i], b[i]);
    me[{a[i] / g, b[i] / g}]++;
  }
  int mx = 0;
  for (auto c : me) {
    mx = max(mx, c.second + cnt);
  }
  mx = max(mx, cnt + val);
  cout << mx << endl;
}
