#include <bits/stdc++.h>
using namespace std;
const long double coef = 1000000;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, cnt = 0;
  cin >> n;
  vector<long long> v(n);
  unordered_map<long double, int> m;
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int i = 0; i < n; ++i) {
    long long a;
    cin >> a;
    if (v[i] != 0 and a != 0)
      m[1.0 * coef * a / v[i]]++;
    else if (v[i] == 0 and a == 0)
      cnt++;
    else if (a == 0)
      m[1.0 * coef * a / v[i]]++;
  }
  int maxi = 0;
  for (auto& i : m) maxi = max(maxi, i.second);
  cout << maxi + cnt;
  return 0;
}
