#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  map<long double, long long int> umap;
  long long int n;
  cin >> n;
  std::vector<long long int> v(n, 0);
  long long int tmp;
  long long int count1 = 0, count2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] == 0) count1++;
  }
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp == 0 && v[i] == 0) {
      count2++;
      continue;
    }
    if (v[i] == 0) continue;
    long double tmp_d = ((-tmp) / (long double)v[i]);
    umap[tmp_d]++;
    ans = max(ans, umap[tmp_d]);
  }
  cout << ans + count2 << endl;
  return 0;
}
