#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long double PI = acos(-1);
const long long MOD = 1000000007;
const long long FMOD = 998244353;
const long double eps = 1e-9;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  map<long double, long long> mp1;
  long long ans = 0, cnt = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (a[i] == 0) {
      if (x == 0) cnt++;
    } else {
      long double d = x / (a[i] * 1.0);
      mp1[d]++;
      ans = max(ans, mp1[d]);
    }
  }
  ans += cnt;
  cout << ans;
}
