#include <bits/stdc++.h>
using namespace std;
int N;
long long A[200005], B[200005];
int any;
map<pair<long long, long long>, int> cnt;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void findd(long long a, long long b) {
  if (a == 0) {
    if (b == 0) any++;
    return;
  }
  long long g = gcd(a, b);
  b /= g, a /= g;
  if (a * b < 0) {
    b = -1 * llabs(b);
    a = llabs(a);
    cnt[make_pair(b, a)]++;
  } else {
    b = llabs(b);
    a = llabs(a);
    cnt[make_pair(b, a)]++;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  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++) findd(A[i], B[i]);
  int mx = 0;
  for (auto ci : cnt) mx = max(mx, ci.second);
  cout << mx + any << '\n';
  return 0;
}
