#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long n;
  cin >> n;
  map<pair<long long, long long>, long long> cnt;
  vector<long long> a(n), b(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  long long zz = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0) {
      zz++;
      continue;
    }
    if (a[i] == 0) continue;
    if (b[i] == 0) {
      cnt[make_pair(0, 1)]++;
      continue;
    }
    long long g = gcd(a[i], b[i]);
    a[i] /= g;
    b[i] /= g;
    cnt[make_pair(a[i], b[i])]++;
  }
  long long maxi = 0;
  for (auto&(x) : (cnt)) {
    maxi = max(maxi, x.second);
  }
  cout << zz + maxi << endl;
}
