#include <bits/stdc++.h>
using namespace std;
void solve(long long int input) {
  long long int n;
  cin >> n;
  double a[n], b[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) cin >> b[i];
  map<long double, long long int> mp;
  long long int ans = 0;
  long long int j = 0;
  for (long long int i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0) {
      j++;
      continue;
    }
    if (a[i] == 0) continue;
    mp[(b[i] / (a[i]))]++;
    ans = max(ans, mp[(b[i] / (a[i]))]);
  }
  cout << ans + j << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int x = 1;
  for (long long int i = 1; i <= x; i++) solve(i);
  return 0;
}
