#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 5;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
long long bp(long long pow, long long n) {
  long long d = 1;
  while (n) {
    if (n % 2 == 1) d = (d * pow) % mod;
    pow = (pow * pow) % mod;
    n /= 2;
  }
  return d;
}
void solve() {
  long long n, mx = 0, zer = 0;
  cin >> n;
  vector<long long> a(n), b(n);
  map<long double, long long> u;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> b[i];
  for (long long i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0) {
      zer++;
      continue;
    }
    if (a[i] == 0) continue;
    if (b[i] == 0) {
      u[0]++;
      mx = max(mx, u[0]);
      continue;
    }
    u[(long double)a[i] / b[i]]++;
    mx = max(mx, u[(long double)a[i] / b[i]]);
  }
  cout << mx + zer;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) solve();
}
