#include <bits/stdc++.h>
using namespace std;
template <typename T>
void scan(T& x) {
  x = 0;
  bool neg = 0;
  register T c = getchar();
  if (c == '-') neg = 1, c = getchar();
  while ((c < 48) || (c > 57)) c = getchar();
  for (; c < 48 || c > 57; c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) x = (x << 3) + (x << 1) + (c & 15);
  if (neg) x *= -1;
}
template <typename T>
void print(T n) {
  bool neg = 0;
  if (n < 0) n *= -1, neg = 1;
  char snum[65];
  int i = 0;
  do {
    snum[i++] = n % 10 + '0';
    n /= 10;
  } while (n);
  --i;
  if (neg) putchar('-');
  while (i >= 0) putchar(snum[i--]);
}
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(char ch) { return string("'") + ch + string("'"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <class InputIterator>
string to_string(InputIterator first, InputIterator last) {
  bool start = true;
  string res = "{";
  while (first != last) {
    if (!start) {
      res += ", ";
    }
    start = false;
    res += to_string(*first);
    ++first;
  }
  res += "}";
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
template <typename A, typename B>
istream& operator>>(istream& input, pair<A, B>& x) {
  input >> x.first >> x.second;
  return input;
}
template <typename A>
istream& operator>>(istream& input, vector<A>& x) {
  for (auto& i : x) input >> i;
  return input;
}
long long powz(int x, int y, int mod) {
  long long res = 1, a, b;
  a = x;
  b = y;
  while (b) {
    if (b & 1) {
      res *= a;
    }
    b /= 2;
    a *= a;
    a %= mod;
    res %= mod;
  }
  return res;
}
long long nCr(long long n, long long k) {
  long long res = 1;
  if (n < k) return 0;
  if (k > n - k) k = n - k;
  for (long long i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
mt19937 rng32((int)chrono::steady_clock::now().time_since_epoch().count());
const int mod = 998244353;
map<long double, int> mp;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  int q = 0, x = 0;
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      if (b[i] == 0) {
        q++;
      }
      continue;
    }
    long double z = -(long double)b[i] / a[i];
    mp[z]++;
  }
  int ans = 0;
  for (auto i : mp) ans = max(ans, i.second);
  ans += q;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
