#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const double pyi = 3.14159265358979323846;
int main() {
  int n;
  scanf("%d", &n);
  ;
  long double arr1[n], arr2[n];
  for (int i = 0; i < n; i++) cin >> arr1[i];
  for (int i = 0; i < n; i++) cin >> arr2[i];
  int cnt = 0;
  map<long double, int> mp;
  for (int i = 0; i < n; i++) {
    if (arr1[i] == 0) {
      if (arr2[i] == 0) cnt++;
    } else
      mp[(long double)(arr2[i] / (arr1[i]))]++;
  }
  int mx = 0;
  for (auto it : mp) {
    mx = max(mx, it.second);
  }
  cout << (cnt + mx) << "\n";
  return (0);
}
