#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
double a[maxn], b[maxn];
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
map<long long, int> s;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &b[i]);
  }
  int maxn = 0;
  int u = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      if (b[i] == 0) {
        u++;
      }
    } else {
      int p = gcd((int)b[i], (int)a[i]);
      b[i] = b[i] / p;
      a[i] = a[i] / p;
      long long j = a[i] * (1e9 + 1) + b[i];
      ++s[j];
      maxn = max(maxn, s[j]);
    }
  }
  cout << maxn + u << endl;
  return 0;
}
