#include <bits/stdc++.h>
using namespace std;
vector<int> a, b;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, k, i, j;
  cin >> n;
  a.resize(n);
  b.resize(n);
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  map<pair<int, int>, int> m;
  int maxx = 0, count = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0)
      count++;
    else if (a[i] != 0) {
      j = gcd(a[i], b[i]);
      m[{b[i] / j, a[i] / j}]++;
    }
  }
  for (auto i = m.begin(); i != m.end(); i++) maxx = max(maxx, i->second);
  cout << maxx + count << endl;
  return 0;
}
