#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const long long maxn = 1000001, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long double a[n], b[n];
  for (long long i = 0; i < (long long)(n); ++i) cin >> a[i];
  for (long long i = 0; i < (long long)(n); ++i) cin >> b[i];
  int ex = 0;
  map<long double, int> freq;
  for (long long i = 0; i < (long long)(n); ++i) {
    if (a[i] == 0 && b[i] == 0) ex++;
    if (a[i] == 0) continue;
    freq[b[i] / a[i]]++;
  }
  int ans = 0;
  for (auto it : freq) {
    ans = max(ans, it.second);
  }
  cout << ans + ex << "\n";
  return 0;
}
