#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i;
  cin >> n;
  long long int a[n], b[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  map<long double, long long int> m;
  long long int ans = 0;
  for (i = 0; i < n; i++) {
    if (a[i] != 0) {
      long double temp = (long double)(-1 * b[i]) / a[i];
      if (temp * a[i] + b[i] == 0) {
        m[temp]++;
        ans = max(ans, m[temp]);
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] == 0 && b[i] == 0) ans++;
  }
  cout << ans;
  return 0;
}
