#include <bits/stdc++.h>
void fast() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
}
long long int gcd(long long int a, long long int b) {
  if (!a) return b;
  return gcd(b % a, a);
}
template <class T>
void print(T a) {
  std::cout << a << "\n";
}
const int MAX = 2 * 111111;
int arr[MAX], brr[MAX];
std::map<long double, int> mp;
int main() {
  int n;
  std::cin >> n;
  for (int i = 0; i < n; i++) std::cin >> arr[i];
  for (int i = 0; i < n; i++) std::cin >> brr[i];
  int tmpmax = 0, max_;
  for (int i = 0; i < n; i++) {
    int b = -1 * brr[i];
    int a = arr[i];
    if (a == 0 && b != 0) {
      continue;
    }
    if (b == 0 && a == 0) {
      tmpmax++;
      continue;
    }
    mp[(long double)b / a]++;
  }
  max_ = tmpmax;
  tmpmax = 0;
  for (auto i : mp) {
    tmpmax = std::max(tmpmax, i.second);
  }
  max_ += tmpmax;
  print(max_);
}
