#include <bits/stdc++.h>
using namespace std;
int arr[200005], arr2[200005], n, repeat = 1, maxi, mas;
long double result[200005];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr2[i]);
    if (arr[i] != 0) {
      result[i] = (arr2[i] / (arr[i] * 1.00000000) * -1.00);
    } else if (arr2[i] == 0) {
      mas++;
      result[i] = -1000000004;
    } else
      result[i] = -1000000004;
  }
  sort(result, result + n);
  for (int i = 1; i < n; i++) {
    if (result[i] == result[i - 1] and result[i] != -1000000004)
      repeat++;
    else {
      if (repeat > maxi and result[i - 1] != -1000000004) maxi = repeat;
      repeat = 1;
    }
  }
  if (repeat > maxi and result[n - 1] != -1000000004) {
    maxi = repeat;
  }
  printf("%d", maxi + mas);
  return 0;
}
