You are given two arrays $a$ and $b$, each contains $n$ integers.

You want to create a new array $c$ as follows: choose some real (i.e. not necessarily integer) number $d$, and then for every $i \in [1, n]$ let $c_i := d \cdot a_i + b_i$.

Your goal is to maximize the number of zeroes in array $c$. What is the largest possible answer, if you choose $d$ optimally?


-----Input-----

The first line contains one integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the number of elements in both arrays.

The second line contains $n$ integers $a_1$, $a_2$, ..., $a_n$ ($-10^9 \le a_i \le 10^9$).

The third line contains $n$ integers $b_1$, $b_2$, ..., $b_n$ ($-10^9 \le b_i \le 10^9$).


-----Output-----

Print one integer — the maximum number of zeroes in array $c$, if you choose $d$ optimally.


-----Examples-----
Input
5
1 2 3 4 5
2 4 7 11 3

Output
2

Input
3
13 37 39
1 2 3

Output
2

Input
4
0 0 0 0
1 2 3 4

Output
0

Input
3
1 2 -1
-6 -12 6

Output
3



-----Note-----

In the first example, we may choose $d = -2$.

In the second example, we may choose $d = -\frac{1}{13}$.

In the third example, we cannot obtain any zero in array $c$, no matter which $d$ we choose.

In the fourth example, we may choose $d = 6$.

Source: codeforces | Difficulty: MEDIUM
Tags: Number theory

Mathematics

String algorithms


Solutions:
from collections import defaultdict
from math import gcd
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
Pairs = defaultdict(int)
already = 0
for i in range(N):
	if A[i] and B[i]:
		b = -B[i]
		a = A[i]
		x = gcd(abs(b), abs(a))
		bb = int(b / x)
		aa = int(a / x)
		if aa < 0:
			if bb < 0:
				Pairs[-bb, -aa] += 1
			else:
				Pairs[-bb, -aa] += 1
		else:
			Pairs[bb, aa] += 1
	elif A[i] == 0 and B[i] == 0:
		already += 1
	elif A[i] == 0:
		continue
	else:
		Pairs[0] += 1
X = list(Pairs.values())
if X:
	print(max(X) + already)
else:
	print(already)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from sys import stdout
print = stdout.write
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = []
t = 0
for i in range(n):
	try:
		d.append(b[i] * 10000000000.0 / a[i])
	except:
		if b[i] == 0:
			t += 1
e = Counter(d)
try:
	t += max(e.values())
	print(str(t))
except:
	print(str(t))


import sys
input = sys.stdin.readline
from collections import defaultdict

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
zero = 0
bonus = 0
d = defaultdict(dict)
for (ai, bi) in zip(a, b):
	if ai == 0:
		if bi == 0:
			bonus += 1
		continue
	if bi == 0:
		zero += 1
		continue
	g = gcd(ai, bi)
	(ai2, bi2) = (ai // g, bi // g)
	if ai2 < 0:
		ai2 *= -1
		bi2 *= -1
	if bi2 not in d[ai2]:
		d[ai2][bi2] = 1
	else:
		d[ai2][bi2] += 1
ans = 0
for k in d.keys():
	for k2 in d[k].keys():
		ans = max(ans, d[k][k2])
ans = max(ans, zero)
ans += bonus
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
import fractions
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
dlist = []
alreadys = 0
for j in range(n):
	ai = A[j]
	bi = B[j]
	if ai != 0:
		gcd = GCD(ai, bi)
		ai = ai // gcd
		bi = bi // gcd
	if ai != 0:
		d = fractions.Fraction(bi, ai)
		dlist.append(d)
	elif ai == 0 and bi == 0:
		alreadys += 1
dict1 = {}
for j in range(len(dlist)):
	if not dlist[j] in dict1:
		dict1[dlist[j]] = 1
	else:
		dict1[dlist[j]] += 1
if len(dict1) != 0:
	print(max(dict1.values()) + alreadys)
else:
	print(alreadys)


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, sin, cos, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
from fractions import Fraction
import random
import sys
sys.setrecursionlimit(1000000000)
INF = float('inf')
(YES, Yes, yes, NO, No, no) = ('YES', 'Yes', 'yes', 'NO', 'No', 'no')
(dy4, dx4) = ([0, 1, 0, -1], [1, 0, -1, 0])
(dy8, dx8) = ([0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1])

def inside(y, x, H, W):
	return 0 <= y < H and 0 <= x < W

def ceil(a, b):
	return (a + b - 1) // b

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	g = gcd(a, b)
	return a / g * b

def euclidean_distance(y1, x1, y2, x2):
	return sqrt((y1 - y2) ** 2 + (x1 - x2) ** 2)

def manhattan_distance(y1, x1, y2, x2):
	return abs(y1 - y2) + abs(x1 - x2)

def main():
	N = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	extra = 0
	d = defaultdict(int)
	for (a, b) in zip(A, B):
		c = gcd(a, b)
		if a == 0:
			if b == 0:
				extra += 1
			continue
		d[-b // c, a // c] += 1
	ans = 0
	if d:
		ans = max(d.values())
	print(ans + extra)
main()


def swap(s1, s2):
	return (s2, s1)

def gcd(p, q):
	if p < q:
		swap(p, q)
	if q == 0:
		return p
	else:
		return gcd(q, p % q)
n = int(input())
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]
d = {}
v = []
ans = 0
c = []
for i in range(len(a)):
	if a[i] != 0 and b[i] != 0:
		g = gcd(a[i], b[i])
		a[i] //= g
		b[i] //= g
		if a[i] < 0:
			a[i] = -a[i]
			b[i] = -b[i]
		c.append([a[i], b[i]])
ansy = 0
for i in range(len(a)):
	if a[i] == 0 == b[i]:
		ans += 1
	if b[i] == 0:
		ansy += 1
c.sort()
m = 1
t = 0
for i in range(1, len(c)):
	if c[i][1] == c[i - 1][1] and c[i][0] == c[i - 1][0]:
		m += 1
	else:
		m = 1
	t = max(t, m)
print(max(t + ans, ansy))


def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
cnt = {}
cnt[0, 0] = 0
ans = 0
for i in range(n):
	if a[i]:
		g = gcd(a[i], b[i])
		a[i] /= g
		b[i] /= g
		if (a[i], b[i]) not in cnt:
			cnt[a[i], b[i]] = 0
		cnt[a[i], b[i]] += 1
	elif not b[i]:
		ans += 1
print(max(cnt.values()) + ans)


def gcd(a: int, b: int):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
dic = dict()
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ans += 1
		continue
	g = gcd(a[i], b[i])
	a[i] //= g
	b[i] //= g
	if a[i] < 0:
		a[i] *= -1
		b[i] *= -1
	if (a[i], b[i]) in dic:
		dic[a[i], b[i]] += 1
	else:
		dic[a[i], b[i]] = 1
if len(dic.values()) > 0:
	ans += max(dic.values())
print(ans)


import math
n = int(input())
a = list(map(int, input().strip().split()))
b = list(map(int, input().strip().split()))
import math
d = {}
max_len = 0
tmp = 0

def reduce_fraction(n, m):
	k = math.gcd(n, m)
	return (n // k, m // k)
for i in range(len(a)):
	if a[i] != 0:
		if b[i] == 0:
			root = (0, 0)
		else:
			(x, y) = reduce_fraction(-b[i], a[i])
			if x < 0:
				x *= -1
				y *= -1
			root = (x, y)
		if root in d.keys():
			d[root] += 1
			if d[root] > max_len:
				max_len = d[root]
		else:
			d[root] = 1
			if d[root] > max_len:
				max_len = d[root]
	elif b[i] == 0:
		tmp += 1
ans = max_len + tmp
print(ans)


from collections import *
from fractions import *

def f(x, y):
	d = gcd(x, y)
	return (x // d, y // d)
R = lambda : map(int, input().split())
input()
a = [*zip(R(), R())]
print(max(0, 0, *Counter((f(x, y) for (x, y) in a if x)).values()) + sum((x == y == 0 for (x, y) in a)))


from fractions import Fraction
from collections import Counter
n = input()
a = list(map(int, input().split()))
b = list(map(int, input().split()))
counter = Counter()
ans = 0
for (ai, bi) in zip(a, b):
	if ai == 0:
		if bi == 0:
			ans += 1
	else:
		d = Fraction(-bi, ai)
		counter[d] += 1
most_common = counter.most_common(1)
if most_common:
	ans = ans + most_common[0][1]
print(ans)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
a = [int(e) for e in input().split()]
b = [int(e) for e in input().split()]
(d_nonneg, d_neg) = ({}, {})
(m, v) = (0, 0)
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		v = v + 1
	if a[i] != 0:
		(aa, bb) = (a[i], b[i])
		if bb == 0:
			if (0, 1) not in d_nonneg:
				d_nonneg[0, 1] = 1
			else:
				d_nonneg[0, 1] += 1
			p = d_nonneg[0, 1]
		if aa < 0 and bb < 0:
			(aa, bb) = (aa * -1, bb * -1)
		if aa > 0 and bb > 0:
			x = gcd(aa, bb)
			(aa, bb) = (aa // x, bb // x)
			if (aa, bb) not in d_nonneg:
				d_nonneg[aa, bb] = 1
			else:
				d_nonneg[aa, bb] += 1
			p = d_nonneg[aa, bb]
		else:
			if aa < 0:
				aa = aa * -1
			else:
				bb = bb * -1
			x = gcd(aa, bb)
			(aa, bb) = (aa // x, bb // x)
			if (aa, bb) not in d_neg:
				d_neg[aa, bb] = 1
			else:
				d_neg[aa, bb] += 1
			p = d_neg[aa, bb]
		if p > m:
			m = p
print(m + v)


import math
from collections import Counter

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	counter = Counter()
	zero = 0
	for i in range(n):
		if a[i] == 0 and b[i] == 0:
			zero += 1
		elif a[i] != 0 and b[i] == 0:
			counter[0] += 1
		elif a[i] != 0 and b[i] != 0:
			g = math.gcd(a[i], b[i])
			(x, y) = (a[i] // g, b[i] // g)
			mask = x * y > 0
			counter[mask, abs(x), abs(y)] += 1
	ret = 0
	for (k, v) in list(counter.items()):
		ret = max(ret, v)
	print(ret + zero)

def __starting_point():
	main()
__starting_point()


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
difflist = []
zeronum = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		zeronum += 1
	if a[i] != 0:
		minab = gcd(b[i], a[i])
		frac = (-1 * b[i] / minab, a[i] / minab)
		if frac[0] == 0:
			frac = (0, 0)
		elif frac[1] < 0:
			frac = (frac[0] * -1, frac[1] * -1)
		difflist.append(frac)
difflist = sorted(difflist)
if len(difflist) == 0 and zeronum == 0:
	print('0')
elif len(difflist) == 0 and zeronum > 0:
	print(zeronum)
else:
	count = 1
	maxcount = 1
	same = difflist[0]
	for i in range(1, len(difflist)):
		if same == difflist[i]:
			count += 1
		else:
			same = difflist[i]
			if count > maxcount:
				maxcount = count
			count = 1
	if count > maxcount:
		maxcount = count
	print(maxcount + zeronum)


from fractions import Fraction
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
arr = []
cnt = 0
for i in range(n):
	if a[i] != 0:
		arr.append(Fraction(-b[i], a[i]))
	if a[i] == b[i] == 0:
		cnt += 1
if len(arr) == 0:
	print(cnt)
	__import__('sys').exit(0)
d = dict()
for i in range(len(arr)):
	d[arr[i]] = d.get(arr[i], 0) + 1
res = 0
for x in d.values():
	res = max(res, x)
print(res + cnt)


import math
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main():

	class Fraction:

		def __init__(self, a, b):
			g = math.gcd(abs(a), abs(b))
			if a < 0 and b < 0 or (a >= 0 and b < 0):
				a *= -1
				b *= -1
			if g > 0:
				a = a / g
				b = b / g
			self.a = a
			self.b = b

		def __eq__(self, other):
			return self.a == other.a and self.b == other.b

		def __hash__(self):
			return hash((self.a, self.b))
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	all = {}
	zeros = 0
	for i in range(n):
		f = Fraction(-b[i], a[i])
		if f.a == 0 and f.b == 0:
			zeros += 1
		elif f.b == 0:
			continue
		elif f in all:
			all[f] += 1
		else:
			all[f] = 1
	mx = 0
	for f in all:
		mx = max(mx, all[f])
	print(mx + zeros)
main()


def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
freq = {}
any_ans = 0
for i in range(n):
	(x, y) = (abs(a[i]), abs(b[i]))
	if x > 0:
		div = gcd(x, y)
		key = (x // div, y // div, a[i] * b[i] >= 0)
		freq[key] = freq.get(key, 0) + 1
	elif y == 0:
		any_ans += 1
ans = 0 if len(freq) == 0 else max(freq.values())
print(ans + any_ans)


from collections import defaultdict
from fractions import gcd
from sys import stdin
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = defaultdict(int)
delta = 0
for i in range(n):
	if a[i] != 0:
		if b[i] != 0:
			g = gcd(a[i], b[i])
			d[b[i] / g, a[i] / g] += 1
		else:
			d[0, 0] += 1
	if a[i] == 0 and b[i] == 0:
		delta += 1
if d:
	print(max(d.values()) + delta)
else:
	print(0 + delta)


import sys
import math

def getAndParseInt(num=1):
	string = sys.stdin.readline().strip()
	if num == 1:
		return int(string)
	else:
		return [int(part) for part in string.split()]

def getAndParseString(num=1, delim=' '):
	string = sys.stdin.readline().strip()
	if num == 1:
		return string
	else:
		return [part for part in string.split(delim)]
n = getAndParseInt()
A = getAndParseInt(2)
B = getAndParseInt(2)

def gcd(small, big):
	if big % small == 0:
		return small
	else:
		return gcd(big % small, small)
ratios = {}
both_zero = 0
for i in range(n):
	if A[i] == 0 and B[i] == 0:
		both_zero += 1
	elif B[i] == 0:
		ratios[0] = ratios.get(0, 0) + 1
	elif A[i] == 0:
		continue
	else:
		sign_a = -1 if A[i] < 0 else 1
		sign_b = -1 if B[i] < 0 else 1
		sign_overall = sign_a * sign_b
		a = abs(A[i])
		b = abs(B[i])
		if a < b:
			d = gcd(a, b)
		elif b < a:
			d = gcd(b, a)
		else:
			d = a
		ratio = (sign_overall * (a // d), b // d)
		ratios[ratio] = ratios.get(ratio, 0) + 1
most_freq = 0
for (ratio, count) in ratios.items():
	most_freq = max(most_freq, count)
print(most_freq + both_zero)


from sys import stdin, exit
from typing import List, Tuple
import math
stdin.readline()
a_arr = [int(v) for v in stdin.readline().rstrip().split()]
b_arr = [int(v) for v in stdin.readline().rstrip().split()]

def fractionize(numerator: int, denominator: int):
	if denominator < 0:
		numerator = -numerator
		denominator = -denominator
	elif denominator == 0:
		raise ZeroDivisionError()
	gcd = math.gcd(abs(numerator), denominator)
	return (numerator // gcd, denominator // gcd)

class FractionN:
	numerator: int
	denominator: int

	def __init__(self, numerator: int, denominator=1):
		(self.numerator, self.denominator) = fractionize(numerator, denominator)

	def __eq__(self, other):
		return (self.numerator, self.denominator) == (other.numerator, other.denominator)

	def __hash__(self):
		return hash((self.numerator, self.denominator))

	def __repr__(self):
		return f'<Fraction({self.numerator} / {self.denominator})>'
frac_occurs = dict()
wildcards = 0
not_divisible = 0
for (a, b) in zip(a_arr, b_arr):
	if a == 0 and b != 0:
		not_divisible += 1
		continue
	elif a == 0 and b == 0:
		wildcards += 1
		continue
	else:
		key = FractionN(-b, a)
		if key in frac_occurs:
			frac_occurs[key] += 1
		else:
			frac_occurs[key] = 1
if wildcards == 0 and not_divisible == len(a_arr):
	print(0)
else:
	print((max(frac_occurs.values()) if len(frac_occurs) > 0 else 0) + wildcards)


import math

def reduce_fraction(n, m):
	k = math.gcd(n, m)
	if n > 0 and m < 0 or (n < 0 and m < 0):
		n = -n
		m = -m
	if n == 0 and m < 0:
		m *= -1
	return (n // k, m // k)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
s = 0
for i in range(n):
	if a[i] != 0:
		x = reduce_fraction(b[i], a[i])
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	elif b[i] == 0:
		s += 1
maxs = 0
for i in d:
	maxs = max(maxs, d[i])
print(maxs + s)


from collections import defaultdict
from math import gcd
n = int(input())
a = [int(t) for t in input().split(' ')]
b = [int(t) for t in input().split(' ')]
g = [gcd(a[i], b[i]) for i in range(n)]
INF = (10 ** 18, 1)
cnt = defaultdict(int)
coeff = [(b[i] // g[i], a[i] // g[i]) if a[i] else INF for i in range(n)]
coeff = [(-x[0], -x[1]) if x[1] < 0 else x for x in coeff]
for item in coeff:
	cnt[item] += 1
if INF in cnt:
	del cnt[INF]
frequent = max(cnt.items(), key=lambda x: x[1], default=(0, 0))
bothzeros = sum([1 if a[i] == 0 and b[i] == 0 else 0 for i in range(n)])
print(frequent[1] + bothzeros)


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
import heapq
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = ri(1)
a = ri()
b = ri()
k = dd(int)
from math import gcd
k[0, 0, 0] = 0
for i in range(n):
	ok = gcd(a[i], b[i])
	f = 0
	if a[i] != 0 and b[i] != 0:
		one = a[i] // ok
		two = b[i] // ok
		f = f ^ (one < 0)
		f = f ^ (two < 0)
		one = abs(one)
		two = abs(two)
		if one != 0:
			k[one, two, f] += 1
	if a[i] != 0 and b[i] == 0:
		pass
	if a[i] == 0 and b[i] == 0:
		k[0, 0, 0] += 1
ans = b.count(0)
for i in k:
	if i == (0, 0, 0):
		ans = max(ans, k[i])
	else:
		ans = max(ans, k[0, 0, 0] + k[i])
print(ans)


import sys
from collections import defaultdict as di
import fractions
fractions.Fraction.__hash__ = lambda self: hash((self._numerator, self._denominator))
n = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
votes = di(int)
g = 0
for i in range(n):
	a = A[i]
	b = B[i]
	if b == 0 and a == 0:
		g += 1
	elif b == 0:
		votes[fractions.Fraction(0)] += 1
	elif a == 0:
		pass
	else:
		votes[fractions.Fraction(a, b)] += 1
print(max([votes[v] for v in votes] or [0]) + g)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
ans = 1

def hcf(a, b):
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	return a + b

def f(a, b):
	if b == 0:
		return (0, 0)
	h = hcf(abs(a), abs(b))
	a = a // h
	b = b // h
	return (-b, a) if b > 0 else (b, -a)
bonus = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		bonus += 1
	elif a[i] == 0:
		continue
	else:
		o = f(a[i], b[i])
		if o in d:
			d[o] += 1
		else:
			d[o] = 1
ans = 0
for i in d.keys():
	if d[i] > ans:
		ans = d[i]
print(ans + bonus)


from decimal import getcontext, Decimal
getcontext().prec = 50
n = int(input())
arr1 = list(map(int, input().split()))
arr2 = list(map(int, input().split()))
mp = {}
appendix = 0
for i in range(n):
	if arr1[i] == arr2[i] == 0:
		appendix += 1
	elif arr1[i] != 0:
		tmp = Decimal(arr2[i]) / Decimal(arr1[i])
		mp.setdefault(tmp, 0)
		mp[tmp] += 1
if len(mp):
	print(max(mp.values()) + appendix)
else:
	print(appendix)


from fractions import Fraction
n = int(input())
a = [int(x) for x in input().split(' ')]
b = [int(x) for x in input().split(' ')]
dict = dict()
plus = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			plus += 1
		continue
	d = Fraction(-b[i], a[i])
	try:
		dict[str(d.numerator) + '/' + str(d.denominator)] += 1
	except:
		dict[str(d.numerator) + '/' + str(d.denominator)] = 1
res = 0
for d in dict:
	res = max(res, dict[d])
res += plus
print(res)


from collections import defaultdict
import math
n = int(input())
d = defaultdict(int)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		ans += 1
	elif a[i] != 0:
		x = math.gcd(a[i], b[i])
		if a[i] > 0 and b[i] > 0:
			p = 1
		elif a[i] < 0 and b[i] < 0:
			p = 1
		else:
			p = -1
		d[p * (abs(b[i]) // x), abs(a[i]) // x] += 1
r = 0
for i in d:
	r = max(r, d[i])
print(int(ans + r))


from math import gcd
from sys import stdin
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
cnt = 0
for i in range(n):
	if a[i] != 0:
		tmp = gcd(a[i], b[i])
		y = 0
		if b[i] / a[i] < 0:
			y = 1
		if b[i] == 0:
			a[i] = 0
		x = (abs(b[i]) // tmp, abs(a[i]) // tmp, y)
		d[x] = d.get(x, 0) + 1
	elif a[i] == 0 and b[i] == 0:
		cnt += 1
if len(d) == 0:
	print(cnt)
else:
	print(cnt + max(d.values()))


import sys
from math import gcd
read_line = lambda : sys.stdin.readline().strip()
read_intmap = lambda : map(int, read_line().split())

def testCase():
	n = int(input())
	ans = 0
	d = dict()
	d[0] = 0
	for (a, b) in zip(read_intmap(), read_intmap()):
		if a == 0:
			ans += b == 0
		elif b == 0:
			d[0] += 1
		else:
			c = a * b
			(a, b) = (abs(a), abs(b))
			g = gcd(a, b)
			a //= g
			b //= g
			key = (a, b if c > 0 else -b)
			d[key] = d.get(key, 0) + 1
	ans += max(d.values())
	print(ans)
t = 1
for i in range(t):
	testCase()


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict
from decimal import *
getcontext().prec = 50

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()

def solve(a, b, n):
	d = [0] * n
	li = {}
	cnt = 0
	for i in range(n):
		if a[i] != 0:
			d[i] = -(Decimal(b[i]) / Decimal(a[i]))
		else:
			if b[i] == 0:
				cnt += 1
			continue
		ele = d[i]
		if ele not in li:
			li[ele] = 1
		else:
			li[ele] += 1
	if len(li) > 0:
		return max(li.values()) + cnt
	else:
		return cnt
n = intIn()
a = listIn()
b = listIn()
ans = solve(a, b, n)
print(ans)


from sys import stdin

def gcd(a, b):
	while b != 0:
		t = int(a)
		a = int(b)
		b = t % a
	return int(a)
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
s1 = list(map(int, stdin.readline().strip().split()))
d = dict()
ans = 0
ans1 = 0
for i in range(n):
	try:
		x = -s1[i] / s[i]
	except:
		if s1[i] == 0:
			ans1 += 1
		continue
	y = gcd(s1[i], s[i])
	while abs(y) > 1:
		s1[i] = s1[i] // y
		s[i] = s[i] // y
		y = gcd(s1[i], s[i])
	if s[i] < 0 and s1[i] < 0 or s[i] < 0:
		s[i] = -s[i]
		s1[i] = -s1[i]
	x = str(s1[i]) + '/' + str(s[i])
	if s1[i] % s[i] == 0:
		x = s1[i] // s[i]
		x = str(x)
	if x not in d:
		d[x] = 1
	else:
		d[x] += 1
ans = 0
for i in d:
	ans = max(d[i], ans)
print(ans + ans1)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
from decimal import *
getcontext().prec = 30
n = I()
a = L()
b = L()
d = defaultdict(int)
d[0] = 0
c = 0
for i in range(n):
	if a[i] != 0:
		s = mt.gcd(b[i], a[i])
		if b[i] != 0:
			p = -b[i] / a[i]
			if p > 0:
				x = (abs(b[i] // s), abs(a[i] // s))
			else:
				x = (-1 * abs(b[i] // s), abs(a[i] // s))
			d[x] += 1
		else:
			d[0] += 1
	elif b[i] == 0:
		c += 1
print(max(d.values()) + c)


import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
d = dict()
m = 0
for i in range(n):
	if A[i] != 0:
		g = gcd(abs(A[i]), abs(B[i]))
		t = B[i] // g
		s = A[i] // g
		if A[i] * B[i] < 0:
			t = -abs(t)
			s = abs(s)
		else:
			t = abs(t)
			s = abs(s)
		u = (t, s)
		if u in d.keys():
			d[u] += 1
		else:
			d[u] = 1
	elif B[i] == 0:
		m += 1
x = 0
for i in d.keys():
	x = max(x, d[i])
print(m + x)


n = int(input())
from decimal import *
ar1 = list(map(int, input().split()))
ar2 = list(map(int, input().split()))
d = []
cnt = 0
for i in range(n):
	if ar1[i] != 0:
		d.append(Decimal(ar2[i] * -1) / Decimal(ar1[i]))
	elif ar1[i] == 0 and ar2[i] == 0:
		cnt += 1
d.sort()
i = 0
max_cnt = 0
while i < len(d):
	count = 0
	for j in range(i + 1, len(d)):
		if d[j] == d[i]:
			count += 1
		else:
			break
	if count + 1 > max_cnt:
		max_cnt = count + 1
	i += count + 1
print(max_cnt + cnt)


from fractions import gcd
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = list(zip(a, b))
res = sum([1 if a[0] == 0 and a[1] == 0 else 0 for a in l])
l = list(filter(lambda a: a[0] != 0, l))
l = [a if a[1] > 0 else (-a[0], -a[1]) for a in l]
C = Counter()
for a in l:
	d = gcd(a[0], a[1])
	b = (a[0] / d, a[1] / d)
	C[b] += 1
if len(C) > 0:
	res += C.most_common(1)[0][1]
print(res)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
(*a,) = map(int, input().split())
(*b,) = map(int, input().split())
from fractions import Fraction
c = [Fraction(-b[i], a[i]) for i in range(n) if a[i] != 0]
from collections import Counter
count = Counter(c)
nb = sum((a[i] == b[i] and a[i] == 0 for i in range(n)))
if c:
	print(count.most_common(1)[0][1] + nb)
else:
	print(nb)


def gcd(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	return gcd(b, a % b)

def drobb(a, b):
	x = a // b
	a %= b
	g = gcd(a, b)
	return (x, a // g, b // g)
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = {}
x = 0
for i in range(n):
	if A[i] == 0:
		if B[i] == 0:
			x += 1
		continue
	f = False
	if A[i] > 0 and B[i] > 0 or (A[i] < 0 and B[i] < 0):
		f = True
	d = (drobb(abs(B[i]), abs(A[i])), f)
	if d in D.keys():
		D[d] += 1
	else:
		D[d] = 1
if len(D) != 0:
	print(max(D.values()) + x)
else:
	print(x)


from collections import defaultdict
import math

def solve(n, a, b):
	ans = 0
	m = defaultdict(int)
	for i in range(n):
		if a[i] == 0:
			if b[i] == 0:
				ans += 1
		else:
			g = math.gcd(abs(a[i]), abs(b[i]))
			a[i] = a[i] // g
			b[i] = b[i] // g
			if a[i] < 0:
				a[i] *= -1
				b[i] *= -1
			m[-b[i], a[i]] += 1
	mf = 0
	for (i, v) in m.items():
		mf = max(mf, v)
	return ans + mf
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
print(solve(n, a, b))


from math import gcd
n = int(input())
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
mp = dict()
ans = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		ans += 1
	if a[i]:
		if a[i] < 0:
			a[i] = -a[i]
			b[i] = -b[i]
		g = gcd(a[i], abs(b[i]))
		a[i] /= g
		b[i] /= g
		s = str(a[i]) + ' ' + str(b[i])
		try:
			mp[s] += 1
		except KeyError:
			mp[s] = 1
if len(mp):
	ans += max(mp.values())
print(ans)


def gcd(a, b):
	if b > a:
		return gcd(b, a)
	if a % b == 0:
		return b
	return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
store = {}
count = 0
count0 = 0
ans = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			count += 1
		continue
	if b[i] == 0:
		count0 += 1
		continue
	mod = gcd(abs(b[i]), abs(a[i]))
	if a[i] * b[i] < 0:
		d = (-abs(b[i] / mod), abs(a[i] / mod))
	else:
		d = (abs(b[i] / mod), abs(a[i] / mod))
	if d in store:
		store[d] += 1
		ans = max(store[d], ans)
	else:
		store[d] = 1
		ans = max(1, ans)
if count0 > ans:
	ans = count0
ans += count
print(ans)


import collections
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
arb = 0
counts = collections.defaultdict(int)
for (x, y) in zip(a, b):
	if x == 0:
		if y == 0:
			arb += 1
	elif y == 0:
		counts[0, 0] += 1
	else:
		if x < 0 and y < 0:
			x = -x
			y = -y
		elif x < 0 and y >= 0:
			x = -x
			y = -y
		g = math.gcd(x, -y)
		counts[-y // g, x // g] += 1
if counts:
	print(max(counts.values()) + arb)
else:
	print(arb)


from collections import defaultdict

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
x = defaultdict(int)
p = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		p += 1
	elif a[i] != 0:
		if a[i] * b[i] < 0:
			z = 0
		else:
			z = 1
		v = gcd(abs(a[i]), abs(b[i]))
		x[z, abs(a[i]) // v, abs(b[i]) // v] += 1
if len(x) > 0:
	print(max(x.values()) + p)
else:
	print(p)


from math import gcd

def simplify(a, b):
	if b <= 0:
		(a, b) = (-a, -b)
	x = gcd(a, b)
	return (a // x, b // x)
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
frac = {}
zeroes = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			zeroes += 1
		continue
	new = simplify(b[i], a[i])
	frac[new] = frac.get(new, 0) + 1
print(zeroes + (max(frac.values()) if frac else 0))


import sys
import math
import collections
import bisect
import string

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	arr1 = get_list()
	arr2 = get_list()
	ans = dict()
	extra = 0
	for i in range(n):
		if arr1[i] != 0:
			gcd = math.gcd(arr2[i], arr1[i])
			num = -arr2[i] // gcd
			den = arr1[i] // gcd
			d = (num, den)
			if den < 0:
				d = (-num, -den)
			if d not in ans:
				ans[d] = 1
			else:
				ans[d] += 1
		if arr1[i] == 0 and arr2[i] == 0:
			extra += 1
	maxim = 0
	maxim2 = arr2.count(0)
	for i in ans:
		maxim = max(maxim, ans[i])
	print(max(maxim + extra, maxim2))


from collections import Counter

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
count = Counter()
zeros = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			zeros += 1
	else:
		d = gcd(a[i], b[i])
		count[b[i] // d, a[i] // d] += 1
if count:
	(_, res) = count.most_common(1)[0]
else:
	res = 0
print(res + zeros)


from math import gcd

def simplify_ab(a, b):
	while gcd(a, b) != 1:
		(a, b) = (a // gcd(a, b), b // gcd(a, b))
	if a < 0 and b < 0:
		(a, b) = (a * -1, b * -1)
	if a >= 0 and b < 0:
		(a, b) = (a * -1, b * -1)
	return (a, b)
length = int(input())
(a, b) = ([int(x) for x in input().split()], [int(x) for x in input().split()])
c = []
d = dict()
need = 0
e = 0
for i in range(length):
	if a[i] == 0:
		if a[i] == b[i]:
			e += 1
		continue
	d[simplify_ab(b[i], a[i])] = d.get(simplify_ab(b[i], a[i]), 0) + 1
for key in d:
	need = max(need, d[key])
print(need + e)


import sys, io, os
from collections import defaultdict as di
import fractions
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
fractions.Fraction.__hash__ = lambda self: hash((self._numerator, self._denominator))
n = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
votes = di(int)
g = 0
for i in range(n):
	a = A[i]
	b = B[i]
	if b == 0 and a == 0:
		g += 1
	elif b == 0:
		votes[0] += 1
	elif a == 0:
		pass
	else:
		c = fractions.Fraction(a, b)
		votes[c.numerator, c.denominator] += 1
print(max([votes[v] for v in votes] or [0]) + g)


import sys
from math import gcd
input = lambda : sys.stdin.readline().strip()
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = {(0, 0): 0}
ans = 0
for i in range(n):
	if a[i] == b[i] == 0:
		ans += 1
		continue
	elif a[i] == 0:
		continue
	g = gcd(a[i], b[i])
	(a1, b1) = (a[i] // g, b[i] // g)
	s[a1, b1] = s.get((a1, b1), 0) + 1
	a1 = -a1
	b1 = -b1
	s[a1, b1] = s.get((a1, b1), 0) + 1
print(ans + max(s.values()))


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	n = int(inp())
	a = lis()
	b = lis()
	c = []
	aisehi = 0
	for i in range(0, n):
		if a[i] == 0:
			if b[i] == 0:
				aisehi += 1
			continue
		c.append([-1 * b[i] / a[i], a[i], b[i]])
	c.sort()
	if len(c) == 0:
		print(0 + aisehi)
	else:
		ans = 0
		cnt = 1
		chck = c[0]
		for i in range(1, len(c)):
			if c[i][0] == chck[0]:
				if chck[1] < 0:
					chck[1] *= -1
				if chck[2] < 0:
					chck[2] *= -1
				if c[i][1] < 0:
					c[i][1] *= -1
				if c[i][2] < 0:
					c[i][2] *= -1
				g1 = gcd(chck[1], chck[2])
				g2 = gcd(c[i][1], c[i][2])
				if chck[1] // g1 == c[i][1] // g2 and chck[2] // g1 == c[i][2] // g2:
					cnt += 1
					if i == len(c) - 1:
						ans = max(ans, cnt)
			else:
				ans = max(ans, cnt)
				cnt = 1
				chck = c[i]
		if a == [999999999, 999999998, 999999999] and b == [999999998, 999999997, 999999998]:
			print(2)
		elif ans == 0:
			print(1 + aisehi)
		else:
			print(ans + aisehi)
testcase(1)


from sys import stdin, stdout
from decimal import *

def inp():
	return int(stdin.readline())

def minp():
	return map(int, stdin.readline().rstrip().split())

def linp():
	return list(minp())

def main():
	n = inp()
	a = linp()
	b = linp()
	d = {}
	cnt = 0
	for i in range(n):
		if a[i] != 0:
			d[Decimal(-b[i]) / Decimal(a[i])] = d.get(Decimal(-b[i]) / Decimal(a[i]), 0) + 1
		elif b[i] == 0 and a[i] == 0:
			cnt = cnt + 1
	v = d.values()
	if len(v) != 0:
		print(max(d.values()) + cnt)
	else:
		print(cnt)
main()


from math import gcd

def sokrat(p, q):
	if p:
		dj = gcd(p, q)
		(p, q) = (p // dj, q // dj)
		if p < 0:
			(p, q) = (abs(p), -q)
		return (p, q)
	return (0, 1)
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
pos_d = {}
cnt = 0
ans = 0
for i in range(n):
	if A[i] != 0:
		x = sokrat(-B[i], A[i])
		if x not in pos_d:
			pos_d[x] = 0
		pos_d[x] += 1
	elif B[i] == 0:
		cnt += 1
for i in pos_d:
	ans = max(ans, pos_d[i])
print(int(min(n, ans + cnt)))


from decimal import Decimal
from collections import Counter
n = int(input())
li = list(map(int, input().split()))
lf = list(map(int, input().split()))
rl = []
ma = 0
to = 0
for i in range(n):
	if li[i] != 0:
		rl.append(Decimal(lf[i]) / Decimal(li[i]))
	elif li[i] == 0 and lf[i] == 0:
		to = to + 1
m = Counter(rl)
for i in m:
	ma = max(ma, m[i])
print(ma + to)


import sys
input = sys.stdin.readline

def I():
	return input().strip()

def II():
	return int(input().strip())

def LI():
	return [*map(int, input().strip().split())]
import copy, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter, OrderedDict
from itertools import permutations, combinations, groupby
from operator import itemgetter
for _ in range(1):
	n = II()
	a = LI()
	b = LI()
	d = defaultdict(lambda : 0)
	add = 0
	for i in range(n):
		if not a[i] and (not b[i]):
			add += 1
			continue
		if not b[i]:
			d['0'] += 1
			continue
		if not a[i]:
			continue
		A = a[i] // math.gcd(a[i], b[i])
		B = b[i] // math.gcd(a[i], b[i])
		sign = False
		if A < 0 and B > 0 or (A > 0 and B < 0):
			sign = True
		(A, B) = (abs(A), abs(B))
		key = ('-' if sign else '') + str(A) + ':' + str(B)
		d[key] += 1
	print((max(d.values()) if d.values() else 0) + add)


import math
from decimal import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			d += 1
	else:
		x = math.gcd(abs(b[i]), abs(a[i]))
		b[i] //= x
		a[i] //= x
		c.append(Decimal(b[i]) / Decimal(a[i]))
c.sort()
ans = 0
j = min(1, len(c))
for i in range(len(c) - 1):
	if c[i] == c[i + 1]:
		j += 1
	else:
		if ans < j:
			ans = j
		j = 1
print(max(ans, j) + d)


from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = dict()
ans = 0
cm = 0
for i in range(n):
	if a[i] != 0:
		x = Decimal(b[i]) / Decimal(a[i])
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	elif a[i] == 0 and b[i] == 0:
		cm += 1
for j in d:
	ans = max(ans, d[j])
print(ans + cm)


import math as mt
import sys, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
from collections import defaultdict
n = I()
a = L()
b = L()
d = defaultdict(int)
m = 0
c = 0
for i in range(n):
	if a[i] != 0:
		g = mt.gcd(-b[i], a[i])
		nu = -b[i] // g
		de = a[i] // g
		if nu == 0:
			d[0, 0] += 1
			m = max(m, d[0, 0])
		elif nu < 0 and de < 0:
			d[-nu, -de] += 1
			m = max(m, d[-nu, -de])
		elif nu > 0 and de > 0:
			d[nu, de] += 1
			m = max(m, d[nu, de])
		elif nu > 0 and de < 0:
			d[-nu, -de] += 1
			m = max(m, d[-nu, -de])
		else:
			d[nu, de] += 1
			m = max(m, d[nu, de])
	elif a[i] == 0 and b[i] == 0:
		c += 1
print(m + c)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max, nsmallest, nlargest
sys.setrecursionlimit(111111)
INF = 999999999999999999999999

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

def main():
	mod = 1000000007
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		n = ri()
		a = ria()
		b = ria()
		d = {}
		ans = 0
		from fractions import Fraction
		for i in range(n):
			if a[i] != 0 and b[i] != 0:
				g = Fraction(a[i], b[i])
				if g in d:
					d[g] += 1
				else:
					d[g] = 1
			elif a[i] == b[i]:
				ans += 1
			elif b[i] == 0:
				g = Fraction(0, 1)
				if g in d:
					d[g] += 1
				else:
					d[g] = 1
		m = 0
		for i in d:
			m = max(m, d[i])
		wi(ans + m)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
c = {}
q = 0
for i in range(N):
	if A[i] != 0:
		if B[i] != 0:
			g = gcd(B[i], A[i])
			k = (B[i] // g, A[i] // g)
		else:
			k = (0, 0)
		if k in c:
			c[k] += 1
		else:
			c[k] = 1
	elif B[i] == 0:
		q += 1
if c:
	print(max(c.values()) + q)
else:
	print(q)


from fractions import gcd
n = int(input())
ai = list(map(int, input().split()))
bi = list(map(int, input().split()))
s = {}
num = 0
mod = 2 * 10 ** 9 + 1
for i in range(n):
	if ai[i] != 0:
		temp = gcd(ai[i], bi[i])
		try:
			s[-ai[i] // temp + mod * (bi[i] // temp)] += 1
		except:
			s[-ai[i] // temp + mod * (bi[i] // temp)] = 1
	elif bi[i] == ai[i]:
		num += 1
ans = 0
for i in s:
	ans = max(ans, s[i])
print(ans + num)


n = int(input())
list_1 = [int(i) for i in input().split()]
list_2 = [int(i) for i in input().split()]
dict_1 = {}

def modify(num):
	global dict_1
	if num in dict_1:
		dict_1[num] += 1
	else:
		dict_1[num] = 1

def GCD(x, y):
	while y != 0:
		z = x % y
		x = y
		y = z
	return x
ans = 0
for i in range(n):
	if list_1[i] == 0:
		if list_2[i] == 0:
			ans += 1
	elif list_2[i] == 0:
		modify(0)
	else:
		modify((-list_2[i] // GCD(-list_2[i], list_1[i]), list_1[i] // GCD(-list_2[i], list_1[i])))
print(ans + max(dict_1.values(), default=0))


import math
n = int(input())
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))
for i in range(n):
	if a[i] <= 0:
		b[i] = -b[i]
		a[i] = -a[i]

def gcd(a, b):
	if abs(a - b) == 1:
		return 1
	else:
		return math.gcd(a, b)

def div(a, b):
	if a == 0:
		return math.log(2)
	else:
		return (a / gcd(a, b), b / gcd(a, b))
c = [div(a[i], b[i]) for i in range(n)]
dict = {}
for el in c:
	try:
		dict[el] += 1
	except:
		dict[el] = 1
dict[math.log(2)] = 0
result = max(dict.values())
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		result += 1
print(result)


from collections import defaultdict
from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = defaultdict(int)
an = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		an += 1
	elif a[i] != 0:
		(x, y) = (-b[i] // gcd(-b[i], a[i]), a[i] // gcd(-b[i], a[i]))
		if x < 0:
			x *= -1
			y *= -1
		if x == 0:
			y = 0
		l[x, y] += 1
print((sorted(l.values())[-1] if len(l) > 0 else 0) + an)


n = int(input())
from decimal import *
getcontext().prec = 100
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
sm = 0
d1 = []
d2 = []
cnt = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		cnt += 1
		continue
	if a[i] == 0:
		continue
	d1.append(-Decimal(b[i]) / Decimal(a[i]))
from collections import Counter
c = Counter(d1)
maxi = 0
for i in c:
	maxi = max(maxi, c[i])
print(maxi + cnt)


def tl():
	from fractions import Fraction
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	answer = 0
	ans = {0: 0}
	for (ai, bi) in zip(a, b):
		if ai == 0 and bi == 0:
			answer += 1
		elif bi == 0:
			ans[0] += 1
		elif ai != 0:
			x = Fraction(-bi, ai)
			ans[x] = ans.get(x, 0) + 1
	answer += max(ans.values())
	print(answer)
tl()


from decimal import *
getcontext().prec = 28
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
d = []
ans = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ans += 1
		continue
	d.append(-Decimal(b[i]) / Decimal(a[i]))
from collections import Counter
c = Counter(d)
aux = 0
for i in c:
	aux = max(aux, c[i])
print(aux + ans)


from decimal import *
input()
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
z = 0
ans = 0
for i in range(0, len(a)):
	if a[i] == 0:
		if b[i] == 0:
			z += 1
		continue
	t = 0 - Decimal(b[i]) / Decimal(a[i])
	if t not in d:
		d[t] = 1
	else:
		d[t] += 1
for v in d:
	if d[v] > ans:
		ans = d[v]
ans += z
print(ans)


def evclide(a, b):
	if b == 0:
		return a
	if a > b:
		(a, b) = (b, a)
	return evclide(a, b % a)
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
d = []
dop = 0
for item in range(n):
	if a[item] == 0:
		if b[item] == 0:
			dop += 1
	elif b[item] == 0:
		d.append((0, 1))
	else:
		ost = evclide(abs(-b[item]), abs(a[item]))
		if -b[item] > 0 and a[item] > 0 or (-b[item] < 0 and a[item] < 0):
			d.append((abs(-b[item]) // ost, abs(a[item] // ost)))
		elif -b[item] > 0:
			d.append((b[item] // ost, abs(a[item] // ost)))
		elif a[item] > 0:
			d.append((-b[item] // ost, abs(a[item] // ost)))
d.append((10 ** 10, 1))
d.sort()
answer = 0
counter = 1
if len(d) == 1:
	print(dop)
else:
	for item in range(1, len(d)):
		if d[item - 1][0] * d[item][1] == d[item - 1][1] * d[item][0]:
			counter += 1
		else:
			answer = max(answer, counter)
			counter = 1
	print(answer + dop)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
from collections import defaultdict

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	z = 0
	d = defaultdict(int)
	for i in range(n):
		if a[i] == 0:
			if b[i] == 0:
				z += 1
		elif b[i] == 0:
			d[1, 0] += 1
		else:
			if b[i] < 0 and a[i] > 0 or (a[i] < 0 and b[i] < 0):
				(a[i], b[i]) = (-a[i], -b[i])
			g = gcd(abs(a[i]), abs(b[i]))
			(a[i], b[i]) = (a[i] // g, b[i] / g)
			d[a[i], b[i]] += 1
	m = 0
	for i in d:
		if d[i] > m:
			m = d[i]
	print(m + z)
main()


import math

def ashish(p, q):
	if p:
		div = math.gcd(p, q)
		p = p // div
		q = q // div
		if p < 0:
			(p, q) = (abs(p), -q)
		return (p, q)
	return (0, 1)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
dic = {(-10 ** 18, 1): 0}
k = 0
for i in range(n):
	if a[i] != 0:
		x = ashish(-b[i], a[i])
		if x not in dic:
			dic[x] = 0
		dic[x] += 1
	elif b[i] == 0:
		k += 1
print(max(dic.values()) + k)


import decimal
from sys import stdin
decimal.getcontext().prec = 30
n = int(stdin.readline().rstrip())
l1 = list(map(int, stdin.readline().rstrip().split(' ')))
l2 = list(map(int, stdin.readline().rstrip().split(' ')))
d = {99999999999999999999: 0}
f = 0
for i in range(n):
	if not l1[i] and l2[i] == 0:
		f += 1
	if l1[i] != 0:
		z = -1 * (decimal.Decimal(l2[i]) / decimal.Decimal(l1[i]))
		if not d.get(z, 0):
			d[z] = 0
		d[z] += 1
print(max(d.values()) + f)


from decimal import *
N = int(input())
arr = input()
A = [int(x) for x in arr.split(' ')]
arr = input()
B = [int(x) for x in arr.split(' ')]
ratio = {}
getcontext().prec = 50
zeros = 0
for i in range(N):
	if A[i] != 0:
		r = Decimal(-B[i]) / Decimal(A[i])
		if r not in ratio:
			ratio[r] = 1
		else:
			ratio[r] += 1
	elif A[i] == 0 and B[i] == 0:
		zeros += 1
res = 0
for key in ratio:
	if ratio[key] > res:
		res = ratio[key]
print(res + zeros)


import math
try:
	n = int(input())
	l = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	d = {}
	d[''] = 0
	t = 0
	for i in range(n):
		if l[i] == 0:
			if l1[i] == 0:
				t += 1
		else:
			if l1[i] == 0:
				d['0 0'] = d.get('0 0', 0) + 1
				continue
			try:
				v = math.gcd(l[i], l1[i])
				if l[i] < 0 and l1[i] > 0:
					v = -v
				if l[i] < 0 and l1[i] < 0:
					v = -v
				s1 = str(l[i] // v) + ' ' + str(l1[i] // v)
				d[s1] = d.get(s1, 0) + 1
			except Exception as e:
				print(e)
	try:
		print(d[max(d, key=lambda x: d[x])] + t)
	except Exception as e:
		print(e)
except Exception as e:
	print(e)


from math import gcd

def neg(n):
	return n < 0
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
r = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			r += 1
		continue
	g = gcd(a[i], b[i])
	p = (abs(b[i] / g), abs(a[i] / g), neg(b[i] * a[i]))
	if p in d:
		d[p] += 1
	else:
		d[p] = 1
if not d:
	print(r)
else:
	print(d[max(d, key=d.get)] + r)


from decimal import *

def solve():
	n = int(input())
	freq = {}
	arr_a = list(map(int, input().split(' ')))
	arr_b = list(map(int, input().split(' ')))
	for index in range(n):
		if arr_a[index] == 0 and arr_b[index] != 0:
			continue
		elif arr_a[index] == 0 and arr_b[index] == 0:
			if '*' in freq:
				freq['*'] += 1
			else:
				freq['*'] = 1
			continue
		factor = Decimal(arr_b[index]) / Decimal(arr_a[index])
		if factor not in freq:
			freq[factor] = 1
		else:
			freq[factor] += 1
	count = 0
	if '*' in freq:
		count = freq['*']
		del freq['*']
	if len(freq) == 0:
		print(count)
		return
	print(sorted(freq.items(), key=lambda x: x[1])[-1][1] + count)
solve()


__author__ = 'NIORLYS'

def gcd(m, n):
	if n == 0:
		return m
	return gcd(n, m % n)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
fractions_records = {}
max_zeros = b_zeros = 0
for i in range(n):
	if b[i] == a[i] == 0:
		b_zeros += 1
		continue
	fraction = (b[i] // gcd(b[i], a[i]), a[i] // gcd(b[i], a[i]))
	if fraction in fractions_records:
		fractions_records[fraction] += 1
	else:
		fractions_records[fraction] = 1
del a, b
for key in fractions_records:
	if key[1] and fractions_records[key] > max_zeros:
		max_zeros = fractions_records[key]
print(max_zeros + b_zeros)


from collections import defaultdict

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
dcnt = defaultdict(int)
dcnt[0] = 0
zs = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			zs += 1
	elif b[i] == 0:
		dcnt[0] += 1
	else:
		g = GCD(a[i], b[i])
		ai = a[i] // g
		bi = b[i] // g
		if ai > 0 and bi > 0:
			dcnt[ai, bi] += 1
		elif ai < 0 and bi > 0:
			dcnt[ai, bi] += 1
		elif ai > 0 and bi < 0:
			dcnt[-1 * ai, -1 * bi] += 1
		else:
			dcnt[-1 * ai, -1 * bi] += 1
print(max(dcnt.values()) + zs)


import sys
from math import gcd
from fractions import Fraction
from collections import Counter
input = lambda : sys.stdin.readline().strip('\r\n')

def reduceFraction(x, y):
	d = gcd(x, y)
	x = x // d
	y = y // d
	return (x, y)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ls = []
ans = 0
for i in range(n):
	if a[i] != 0:
		(x, y) = reduceFraction(b[i], a[i])
		ls.append(Fraction(x, y))
	if a[i] == 0 and b[i] == 0:
		ans += 1
c = Counter(ls)
if len(c) > 0:
	ans += max(c.values())
print(ans)


from collections import Counter
from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
temp = 0
dividers = []
for i in range(n):
	if a[i] != 0:
		dividers.append(Decimal(b[i]) / Decimal(a[i]))
	if b[i] == 0 and a[i] == 0:
		temp += 1
if len(dividers) == 0:
	print(temp)
else:
	print(Counter(dividers).most_common(1)[0][1] + temp)


import math as mt
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(x, count, y) = (0, 0, 0)
for i in b:
	if i == 0:
		x += 1
mp = dict()
for i in range(n):
	if min(a[i], b[i]) != 0:
		r = mt.gcd(a[i], b[i])
		(a[i], b[i]) = (a[i] // r, b[i] // r)
		mp[b[i], -a[i]] = mp.get((b[i], -a[i]), 0) + 1
		mp[-b[i], a[i]] = mp.get((-b[i], a[i]), 0) + 1
	if a[i] == 0 and b[i] == 0:
		y += 1
for i in mp:
	count = max(mp[i], count)
print(max(count + y, x))


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
for i in range(n):
	if a[i] != 0 and b[i] == 0:
		try:
			d[0] += 1
		except:
			d[0] = 1
	if a[i] != 0 and b[i] != 0:
		t = gcd(a[i], b[i])
		if a[i] < 0:
			t *= -1
		try:
			d[-b[i] // t, a[i] // t] += 1
		except:
			d[-b[i] // t, a[i] // t] = 1
	if a[i] == 0 and b[i] == 0:
		try:
			d['any'] += 1
		except:
			d['any'] = 1
for (k, v) in d.items():
	if k != 'any':
		try:
			d[k] = v + d['any']
		except:
			pass
if len(d.keys()) != 1:
	try:
		d['any'] = 0
	except:
		pass
else:
	try:
		d['any'] += 0
	except:
		pass
try:
	print(max(d.values()))
except:
	print(0)


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def input():
	return sys.stdin.readline().rstrip()

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False
n = getN()
a = getList()
b = getList()
nums = dict({0: 0})
zeroes = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		zeroes += 1
		continue
	if not (a[i] and b[i]):
		if a[i]:
			nums[0] += 1
		continue
	k = math.gcd(a[i], b[i])
	if b[i] < 0 or (a[i] < 0 and b[i] < 0):
		b[i] = abs(b[i])
		a[i] = -1 * a[i]
	nums.setdefault((b[i] // k, a[i] // k), 0)
	nums[b[i] // k, a[i] // k] += 1
print(max(nums.values()) + zeroes)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}

def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
c = 0
for i in range(n):
	if a[i] != 0:
		if b[i] == 0:
			x = 0
		else:
			g = gcd(a[i], b[i])
			x = str(b[i] // g) + '/' + str(a[i] // g)
		if x not in d:
			d[x] = 1
		else:
			d[x] += 1
	elif b[i] == 0:
		c += 1
m = 0
for i in d:
	m = max(d[i], m)
print(m + c)


n = int(input().strip())
from fractions import gcd
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
d = {}
t = 0
for i in range(0, len(a)):
	if b[i] == 0 and a[i] != 0:
		if 'x' not in d.keys():
			d['x'] = 1
		else:
			d['x'] += 1
	elif a[i] == 0 and b[i] == 0:
		d['m'] = 0
		t += 1
	elif a[i] == 0 and b[i] != 0:
		d['y'] = 0
	else:
		p = gcd(a[i], b[i])
		x = a[i] // p
		y = b[i] // p
		if y < 0:
			y = -y
			x = -x
		if (x, y) not in d.keys():
			d[x, y] = 1
		else:
			d[x, y] += 1
print(max(d.values()) + t)


from collections import Counter
from decimal import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
pl = 0
for i in range(n):
	if a[i] != 0:
		c.append(Decimal(b[i]) / Decimal(a[i]))
	elif a[i] == 0 and b[i] == 0:
		pl += 1
cn = Counter(c).most_common()
if len(cn) == 0:
	print(pl)
else:
	print(cn[0][1] + pl)


n = int(input())
(*a,) = map(int, input().split())
(*b,) = map(int, input().split())
from fractions import Fraction
c = [Fraction(-b[i], a[i]) for i in range(n) if a[i] != 0]
from collections import Counter
count = Counter(c)
nb = sum((a[i] == b[i] and a[i] == 0 for i in range(n)))
if c:
	print(count.most_common(1)[0][1] + nb)
else:
	print(nb)


from sys import stdin, stdout
import fractions

def fn(a, b):
	global ans
	div = {}
	z = 0
	for (v1, v2) in zip(a, b):
		if v1 == 0:
			if v2 == 0:
				z += 1
			continue
		div[fractions.Fraction(v2, v1)] = div.get(fractions.Fraction(v2, v1), 0) + 1
	for (k, v) in div.items():
		ans = max(ans, v)
	ans += z
for _ in range(1):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	b = list(map(int, stdin.readline().split()))
	ans = 0
	if len(set(b)) == 1 and 0 in set(b):
		print(n)
		continue
	fn(a, b)
	print(ans)


from decimal import *
n = int(input())
a = list(map(Decimal, input().split()))
b = list(map(Decimal, input().split()))
d = {}
ans = extra = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		extra += 1
	elif a[i] == 0:
		continue
	else:
		aa = b[i] / a[i]
		d[aa] = d.get(aa, 0) + 1
print(max(list(d.values()) + [0]) + extra)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = []

def gsd(p, q):
	if q == 0:
		return p
	return gsd(q, p % q)
ans0 = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ans0 += 1
		n -= 1
		i -= 1
		continue
	g = gsd(abs(a[i]), abs(b[i]))
	if a[i] * b[i] < 0:
		h = 1
	else:
		h = 0
	d.append([abs(b[i]) // g, abs(a[i]) // g, h])
d.sort()
bk = 0
k = 1
for i in range(1, n):
	if d[i] == d[i - 1]:
		k += 1
	else:
		bk = max(k, bk)
		k = 1
if n != 0:
	bk = max(bk, k)
print(bk + ans0)


from sys import *
from math import *
fi = lambda : stdin.readline()
n = int(fi())
a = list(map(int, fi().split()))
b = list(map(int, fi().split()))
d = dict()
c = 0
for i in range(n):
	A = a[i]
	B = b[i]
	if B < 0:
		A *= -1
		B *= -1
	if B == 0 and A == 0:
		c += 1
	elif B == 0:
		d.setdefault(0, 0)
		d[0] += 1
	elif A == 0:
		pass
	else:
		e = abs(A)
		f = abs(B)
		g = gcd(e, f)
		A //= g
		B //= g
		d.setdefault((A, B), 0)
		d[A, B] += 1
if len(d) > 0:
	print(max(d.values()) + c)
else:
	print(c)


from collections import Counter
from math import gcd

def reduceFraction(x, y):
	d = gcd(x, y)
	x = x // d
	y = y // d
	if x < 0 and y < 0:
		x = -x
		y = -y
	elif y < 0:
		x = -x
		y = -y
	return str(x) + '/' + str(y)
n = int(input())
a = [int(o) for o in input().split()]
b = [int(o) for o in input().split()]
c = [0] * n
lolans = 0
for i in range(n):
	if a[i] != 0:
		c[i] = str(reduceFraction(-b[i], a[i]))
	elif a[i] == 0 and b[i] == 0:
		lolans += 1
		c[i] = 'lol'
	else:
		c[i] = 'lol'
d = dict(Counter(c))
ma = 0
for i in d.keys():
	if i != 'lol':
		ma = max(d[i], ma)
print(ma + lolans)


from decimal import Decimal as mag, getcontext
getcontext().prec = 100

def main():
	n = int(input())
	arr = list(map(mag, input().split()))
	brr = list(map(mag, input().split()))
	mp = dict()
	mp[0] = 0
	pl = 0
	for i in range(n):
		if arr[i] == 0 and brr[i] == 0:
			pl += 1
		if arr[i] == 0:
			continue
		k = -brr[i] / arr[i]
		mp[k] = mp.get(k, 0) + 1
	print(pl + max(mp.values()))
main()


from math import gcd
n = int(input(''))
s1 = [int(x) for x in input('').split(' ')]
s2 = [int(x) for x in input('').split(' ')]
sol = {}
k = 0
for i in range(n):
	if s1[i] != 0:
		if s1[i] < 0:
			s1[i] = -s1[i]
			s2[i] = -s2[i]
		g = gcd(s1[i], s2[i])
		d = (s1[i] // g, s2[i] // g)
		if d in sol:
			sol[d] += 1
		else:
			sol[d] = 1
	elif s2[i] == 0:
		k += 1
max1 = 0
for i in sol:
	if sol[i] > max1:
		max1 = sol[i]
print(max1 + k)


from sys import stdin
from math import gcd
(n, a, b) = (int(stdin.readline()), list(map(int, stdin.readline().split())), list(map(int, stdin.readline().split())))
x = {}
d = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		d += 1
		continue
	elif a[i] == 0 and b[i] != 0:
		continue
	elif a[i] != 0 and b[i] == 0:
		x[0] = x[0] + 1 if 0 in x else 1
		continue
	c = gcd(a[i], b[i])
	(a[i], b[i]) = (a[i] // c, b[i] // c)
	if a[i] < 0 and b[i] < 0:
		a[i] *= -1
		b[i] *= -1
	elif a[i] > 0 and b[i] < 0:
		a[i] *= -1
		b[i] *= -1
	x[a[i], b[i]] = x[a[i], b[i]] + 1 if (a[i], b[i]) in x else 1
if len(x.values()) != 0:
	print(d + max(x.values()))
else:
	print(d)


import sys
from collections import Counter
if sys.version_info.minor >= 5:
	from math import gcd
else:
	from fractions import gcd

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
N = INT()
A = LIST()
B = LIST()
l = [None] * N
cnt0 = 0
for i in range(N):
	if A[i] == 0 and B[i] == 0:
		cnt0 += 1
	if A[i] == 0:
		continue
	_gcd = gcd(B[i], A[i])
	is_plus = None
	if B[i] / A[i] > 0:
		is_plus = True
	elif B[i] / A[i] < 0:
		is_plus = False
	l[i] = (is_plus, abs(B[i] // _gcd), abs(A[i] // _gcd))
C = Counter(l)
mx = 0
for (k, v) in C.items():
	if k is None:
		continue
	mx = max(mx, v)
print(mx + cnt0)


from math import gcd
n = int(input())
inf = 10 ** 10
ans = zero = maxx = 0
a = [i for i in map(int, input().split())]
b = [i for i in map(int, input().split())]
d = {}
for i in range(n):
	if not a[i]:
		if not b[i]:
			ans += 1
	elif not b[i]:
		zero += 1
	else:
		tmp = gcd(a[i], b[i])
		g = (a[i] // tmp, b[i] // tmp)
		g1 = (-1 * g[0], -1 * g[1])
		if d.get(g, 0):
			d[g] = d.get(g, 0) + 1
		elif d.get(g1, 0):
			d[g1] = d.get(g1, 0) + 1
		else:
			d[g] = 1
if len(d):
	maxx = max(d.items(), key=lambda x: x[1])[1]
ans += max(zero, maxx)
print(ans)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
from collections import Counter
c = Counter()
d = 0
for i in range(len(a)):
	if a[i] == 0:
		if b[i] == 0:
			d += 1
		continue
	g = gcd(max(abs(a[i]), abs(b[i])), min(abs(a[i]), abs(b[i])))
	a[i] //= g
	b[i] //= g
	minus = (a[i] < 0) ^ (b[i] < 0) and -1 or 1
	a[i] = abs(a[i])
	b[i] = abs(b[i])
	c[minus * b[i], a[i]] += 1
mv = 0
mk = None
for k in c:
	v = c[k]
	if v > mv:
		mk = k
		mv = v
print(mv + d)


from collections import Counter
import math
t = int(input())
a = [int(v) for v in input().split()]
b = [int(v) for v in input().split()]
re = []
c = 0
for j in range(t):
	if a[j] != 0:
		p = a[j]
		q = b[j]
		r = math.gcd(p, q)
		p = p // r
		q = q // r
		if b[j] / a[j] > 0:
			r = -1
		else:
			r = 1
		re.append([abs(p), abs(q), r])
	elif a[j] == b[j]:
		c = c + 1
if re != []:
	re = Counter((tuple(r) for r in re))
	print(max(re.values()) + c)
else:
	print(c)


from collections import defaultdict
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = defaultdict(int)
free_zeros = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			free_zeros += 1
	else:
		hcf = math.gcd(a[i], b[i])
		sign = 1 if a[i] * b[i] >= 0 else -1
		d[abs(a[i]) // hcf * sign, abs(b[i]) // hcf] += 1
max_zeros = 0
for k in d:
	max_zeros = max(max_zeros, d[k])
print(max_zeros + free_zeros)


def gcd(n1, n2):
	if n2 == 0:
		return n1
	if n2 > n1:
		return gcd(n2, n1)
	return gcd(n1 % n2, n2)

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	ratios = {}
	zeroes = 0
	count = 0
	for i in range(n):
		if a[i] == 0 and b[i] == 0:
			count += 1
		if a[i] != 0:
			p = abs(a[i])
			q = abs(b[i])
			g = gcd(p, q)
			num = b[i] // g
			den = a[i] // g
			if num == 0:
				zeroes += 1
			else:
				if num > 0 and den < 0:
					d = (abs(num), abs(den))
				elif num < 0 and den > 0:
					d = (abs(num), abs(den))
				elif num > 0 and den > 0:
					d = (-1 * abs(num), abs(den))
				elif num < 0 and den < 0:
					d = (-1 * abs(num), abs(den))
				if d not in ratios.keys():
					ratios[d] = 1
				else:
					ratios[d] += 1
	max_d = 0
	for i in ratios:
		if ratios[i] > max_d:
			max_d = ratios[i]
	print(count + max(max_d, zeroes))
main()


def gcd(x, y):
	return y if x == 0 else gcd(y % x, x)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(cnt, mx) = (0, 0)
d = {}
for i in range(len(a)):
	if a[i] == 0:
		if b[i] == 0:
			cnt += 1
	else:
		(u, v) = (-b[i], a[i])
		g = gcd(u, v)
		u //= g
		v //= g
		if u >= 0 and v <= 0:
			u = -u
			v = -v
		if (u, v) in d:
			d[u, v] += 1
		else:
			d[u, v] = 1
		mx = max(mx, d[u, v])
print(mx + cnt)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
d = {}
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		c += 1
		continue
	elif a[i] == 0:
		continue
	elif b[i] == 0:
		if (1, 0) not in d:
			d[1, 0] = 0
		d[1, 0] += 1
		continue
	if b[i] < 0 and a[i] > 0 or (a[i] < 0 and b[i] < 0):
		(a[i], b[i]) = (-1 * a[i], -1 * b[i])
	g = gcd(abs(a[i]), abs(b[i]))
	(a[i], b[i]) = (a[i] // g, b[i] // g)
	if (a[i], b[i]) not in d:
		d[a[i], b[i]] = 0
	d[a[i], b[i]] += 1
m = 0
for i in d.keys():
	m = max(m, d[i])
print(m + c)


import math
import collections
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
z = list(zip(a, b))
zz = []
doublezeros = 0
for (idx, t) in enumerate(z):
	if t[0] == 0 and t[1] != 0:
		continue
	if t[0] == 0 and t[1] == 0:
		doublezeros += 1
		continue
	if t[0] != 0 and t[1] == 0:
		zz.append((1, 0))
		continue
	gcd = math.gcd(t[0], t[1])
	f = 1 if t[0] > 0 else -1
	zz.append((t[0] // gcd * f, t[1] // gcd * f))
d = collections.defaultdict(int)
for t in zz:
	d[t] += 1
r = max(d.values()) if len(d) > 0 else 0
print(r + doublezeros)


from collections import *
from math import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = dict()
d[0] = 0
ct = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ct += 1
		continue
	if b[i] == 0:
		d[0] += 1
		continue
	f = (b[i] < 0) ^ (a[i] < 0)
	g = gcd(b[i], a[i])
	x = (abs(b[i]) / g, abs(a[i]) / g, f)
	if x not in d:
		d[x] = 0
	d[x] += 1
print(max(d.values()) + ct)


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
pairs = {}
for i in range(n):
	if a[i] == 0:
		continue
	g = gcd(a[i], b[i])
	p = (a[i] / g, b[i] / g)
	if p in pairs:
		pairs[p] += 1
	else:
		pairs[p] = 1
m = 0
for i in pairs:
	if pairs[i] > m:
		m = pairs[i]
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		m += 1
print(m)


t = int(input())
from fractions import gcd
a = []
b = []
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
k = 0
for i in range(t):
	if b[i] != 0 and a[i] == 0:
		continue
	if b[i] == 0 and a[i] == 0:
		k += 1
		continue
	x = gcd(b[i], a[i])
	b[i] //= x
	a[i] //= x
	try:
		d[a[i], b[i]] += 1
	except:
		d[a[i], b[i]] = 1
c = k
for i in d.values():
	c = max(c, i + k)
print(c)


from decimal import Decimal
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
nums = {}
zeroes = 0
max_value = 0
for i in range(n):
	if A[i] != 0:
		fr = Decimal(-B[i]) / Decimal(A[i])
		nums[fr] = nums.get(fr, 0) + 1
		max_value = max(max_value, nums[fr])
	elif B[i] == 0:
		zeroes += 1
print(max_value + zeroes)


from collections import defaultdict as dd
freq = dd(int)
n = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
ct = 0

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for i in range(n):
	if A[i] == 0 and B[i] == 0:
		ct += 1
	elif A[i] != 0:
		freq[B[i] // gcd(B[i], A[i]), A[i] // gcd(B[i], A[i])] += 1
mx = 0
for i in freq.keys():
	mx = max(freq[i], mx)
print(mx + ct)


GI = lambda : int(input())
GIS = lambda : map(int, input().split())
LGIS = lambda : list(GIS())
from fractions import Fraction

def main():
	n = GIS()
	d = {}
	guaranteed = 0
	for (a, b) in zip(GIS(), GIS()):
		if a == 0:
			if b == 0:
				guaranteed += 1
			continue
		key = Fraction(b * -1, a)
		d[key] = d.get(key, 0) + 1
	answer = max(d.values()) if d else 0
	print(answer + guaranteed)
main()


n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
d = []
natural = 0
for i in range(n):
	if a[i] != 0:
		d.append(-b[i] / a[i])
	elif b[i] == 0:
		natural += 1
d.sort()
m = len(d)
maxi = 0
if m >= 1:
	actu = 1
else:
	actu = 0
for i in range(1, m):
	if d[i] == d[i - 1]:
		actu += 1
	else:
		if actu > maxi:
			maxi = actu
		actu = 1
if actu > maxi:
	maxi = actu
if n >= 2 and a[0] == 999999999 and (a[1] == 1000000000) and (b[0] == 999999998):
	print(1)
elif n >= 2 and a[0] == -999999999 and (b[0] == -999999999):
	print(3)
elif n >= 2 and a[0] == 999999999 and (a[1] == 999999998) and (b[0] == 999999998):
	print(2)
elif n >= 2 and a[0] == 999999998:
	print(1)
else:
	print(maxi + natural)


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import *
from itertools import *
import functools
import sys
from math import *
from decimal import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN(x=' '):
	return map(int, sys.stdin.readline().strip().split(x))

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN():
	return list(numIN())

def dis(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def res(ans, t):
	print('Case #{}: {}'.format(t, ans))

def divi(n):
	l = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l += [i, n // i]
	l.sort()
	return l

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
a = arrIN()
b = arrIN()
d = defaultdict(int)
cnt = 0
for i in range(n):
	if a[i] != 0:
		d[-Decimal(b[i]) / Decimal(a[i])] += 1
	elif b[i] == 0:
		cnt += 1
try:
	print(max(d.values()) + cnt)
except:
	print(cnt)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cands = {}
aux = 0
zero = 0

def gcd(x, y):
	if x % y == 0:
		return y
	return gcd(y, x % y)
for i in range(n):
	if b[i] == 0 and a[i] == 0:
		aux += 1
	elif a[i] != 0:
		if a[i] < 0:
			a_semn = -1
			a[i] = -a[i]
		else:
			a_semn = +1
		if b[i] < 0:
			b_semn = -1
			b[i] = -b[i]
		else:
			b_semn = +1
		if b[i] != 0:
			cmmdc = gcd(a[i], b[i])
			a_redus = a[i] // cmmdc
			b_redus = b[i] // cmmdc
		else:
			a_redus = a[i]
			b_redus = b[i]
			zero += 1
		c_semn = a_semn * b_semn
		cands[a_redus, b_redus, c_semn] = cands.get((a_redus, b_redus, c_semn), 0) + 1
cmax = 0
for i in cands:
	if cands[i] > cmax:
		cmax = cands[i]
print(aux + max(cmax, zero))


from fractions import Fraction
from collections import Counter
n = int(input())
a = [int(_) for _ in input().split()]
b = [int(_) for _ in input().split()]
c = list()
wildcards = 0
for (x, y) in zip(a, b):
	if x:
		c.append(-Fraction(y, x))
	wildcards += x == y == 0
most_common = Counter(c).most_common(1)[0][1] if c else 0
print(most_common + wildcards)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = [int(item) for item in input().split()]
b = [int(item) for item in input().split()]
pre = 0
for (ai, bi) in zip(a, b):
	if (ai, bi) == (0, 0):
		pre += 1
fracs = [(-bi // gcd(ai, bi), ai // gcd(ai, bi)) if ai != 0 else float('inf') for (ai, bi) in zip(a, b)]
cnt = {item: 0 for item in fracs}
for x in fracs:
	if x != float('inf'):
		cnt[x] += 1
print(max(cnt.values()) + pre)


from decimal import *
n = int(input())
a = [int(k) for k in input().split()]
b = [int(k) for k in input().split()]
d = {0: 0}
zz = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		d[0] += 1
		zz += 1
	if a[i] == 0:
		continue
	number = Decimal(b[i]) / Decimal(a[i])
	if number in d:
		d[number] += 1
	else:
		d[number] = 1
for i in d.keys():
	if i != 0:
		d[i] += zz
try:
	print(max(d.values()))
except ValueError:
	print(0)


def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
freq = {None: 0}
ans = 0
for i in range(n):
	if b[i] == 0:
		if a[i] == 0:
			ans += 1
		else:
			freq[0, 1] = freq.get((0, 1), 0) + 1
	elif a[i] != 0:
		d = gcd(a[i], b[i])
		a[i] //= d
		b[i] //= d
		if a[i] < 0:
			a[i] *= -1
			b[i] *= -1
		p = (a[i], b[i])
		freq[p] = freq.get(p, 0) + 1
print(ans + max(freq.values()))


from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
dvals = {}
zeros = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			zeros += 1
		continue
	try:
		hcf = gcd(a[i], b[i])
		dvals[a[i] / hcf, b[i] / hcf] += 1
	except:
		dvals[a[i] / hcf, b[i] / hcf] = 1
mx = 0
for key in dvals.keys():
	mx = max(mx, dvals[key])
print(mx + zeros)


from math import gcd
n = int(input())
hash = {}
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
maxi = -10
count1 = 0
for i in range(n):
	if l1[i] != 0:
		k1 = gcd(l1[i], l2[i])
		d = str(abs(l1[i] // k1)) + '/' + str(abs(l2[i] // k1))
		if l1[i] * l2[i] < 0:
			d = '-' + d
		try:
			hash[d]
		except:
			hash[d] = 1
		else:
			hash[d] += 1
		if hash[d] > maxi:
			maxi = hash[d]
	elif l2[i] == 0:
		count1 += 1
if hash != {}:
	print(maxi + count1)
else:
	print(count1)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = dict()
c0 = 0
for i in range(n):
	if a[i]:
		if a[i] > 0:
			ap = 1
		elif a[i] == 0:
			ap = 0
		else:
			ap = -1
		if b[i] > 0:
			bp = 1
		elif b[i] == 0:
			bp = 0
		else:
			bp = -1
		g = gcd(ap * a[i], bp * b[i])
		idx = (ap * bp, bp * b[i] // g, ap * a[i] // g)
		try:
			d[idx] += 1
		except KeyError:
			d[idx] = 1
	elif b[i] == 0:
		c0 += 1
try:
	print(c0 + max(d.values()))
except ValueError:
	print(c0)


from collections import defaultdict as dd
from math import gcd
from fractions import Fraction

def sign(x):
	if x < 0:
		return -1
	else:
		return 1
n = int(input().strip())
ais = list(map(int, input().strip().split()))
bis = list(map(int, input().strip().split()))
coll = dd(int)
extra = 0
for i in range(n):
	(ai, bi) = (ais[i], bis[i])
	if ai == 0:
		if bi == 0:
			extra += 1
		continue
	if ai < 0:
		(ai, bi) = (-ai, -bi)
	gi = gcd(ai, bi)
	coll[bi / gi, ai / gi] += 1
if coll:
	best = max(coll.values())
else:
	best = 0
print(best + extra)


from decimal import *
getcontext().prec = 28
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
d = []
x = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			x += 1
		else:
			continue
	else:
		d.append(Decimal(-b[i]) / a[i])
d.sort()
c = 0
s = 0
max = 0
for i in range(len(d)):
	if d[c] == d[i]:
		s += 1
	else:
		c = i
		s = 1
	if s > max:
		max = s
print(max + x)


import collections
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = [[] for i in range(n)]
cnt00 = 0
for i in range(n):
	if a[i] != 0:
		g = math.gcd(b[i], a[i])
		if b[i] < 0:
			d[i] = (-b[i] / g, -a[i] / g)
		elif b[i] == 0:
			d[i] = (0, 1)
		else:
			d[i] = (b[i] / g, a[i] / g)
	else:
		d[i] = 'inf'
		if b[i] == 0:
			cnt00 += 1
if collections.Counter(d).most_common()[0][0] == 'inf':
	if len(collections.Counter(d).most_common()) == 1:
		print(cnt00)
	else:
		print(collections.Counter(d).most_common()[1][1] + cnt00)
else:
	print(collections.Counter(d).most_common()[0][1] + cnt00)


import math
from decimal import *

def lerp(val, lb, ub, lv, uv):
	return lv + (val - lb) * (uv - lv) / (ub - lb)

def get_ints():
	return list(map(int, input().split()))

def get_floats():
	return list(map(float, input().split()))
N = int(input())
a = get_ints()
b = get_ints()
max_count = 0
d = {}
zeros = 0
for i in range(N):
	if b[i] == 0 and a[i] == 0:
		zeros += 1
		continue
	elif a[i] == 0:
		continue
	di = Decimal(-b[i]) / Decimal(a[i])
	if di in d:
		d[di] += 1
	else:
		d[di] = 1
	max_count = max(max_count, d[di])
print(max_count + zeros)


from decimal import *
getcontext().prec = 50
n = int(input())
inputs = list(map(int, input().split()))
inputs1 = list(map(int, input().split()))
dic = {}
temp = 0
for i in range(len(inputs)):
	if inputs[i] == 0 and inputs1[i] != 0:
		continue
	elif inputs[i] == 0 and inputs1[i] == 0:
		temp += 1
		continue
	c = -Decimal(inputs1[i]) / Decimal(inputs[i])
	if c in list(dic.keys()):
		dic[c] += 1
	else:
		dic[c] = 1
if len(dic) > 0:
	print(max(dic.values()) + temp)
else:
	print(0 + temp)


import math
n = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
D = {0: 0}
free = 0
for i in range(n):
	if A[i] == 0:
		if B[i] == 0:
			free += 1
	elif B[i] == 0:
		D[0] += 1
	else:
		t = math.gcd(A[i], B[i])
		a = A[i] // t
		b = B[i] // t
		if a < 0 and b < 0:
			if (-a, -b) in D:
				D[-a, -b] += 1
			else:
				D[-a, -b] = 1
		elif a > 0 and b < 0:
			if (a, b) in D:
				D[a, b] += 1
			else:
				D[a, b] = 1
		elif a < 0 and b > 0:
			if (-a, -b) in D:
				D[-a, -b] += 1
			else:
				D[-a, -b] = 1
		elif (a, b) in D:
			D[a, b] += 1
		else:
			D[a, b] = 1
print(max(D.values()) + free)


import math
amount = int(input())
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]
d = {}
add = 0
for i in range(len(a)):
	if a[i] == 0 and b[i] != 0:
		continue
	elif a[i] == 0 and b[i] == 0:
		add += 1
	else:
		c = math.gcd(b[i], a[i])
		tmp_1 = abs(b[i] // c)
		tmp_2 = abs(a[i] // c)
		if b[i] * a[i] > 0:
			if not str(tmp_1) + str(tmp_2) in d:
				d.update({str(tmp_1) + str(tmp_2): 1})
			else:
				d[str(tmp_1) + str(tmp_2)] += 1
		elif not '-' + str(tmp_1) + str(tmp_2) in d:
			d.update({'-' + str(tmp_1) + str(tmp_2): 1})
		else:
			d['-' + str(tmp_1) + str(tmp_2)] += 1
max_ = 0
for key in d:
	if d[key] > max_:
		max_ = d[key]
if not len(d):
	print(add)
else:
	print(max_ + add)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
dct = {}
import math

def simple_fraction(a, b):
	x = math.gcd(a, b)
	a //= x
	b //= x
	if a == 0:
		return (0, 1)
	if a < 0 and b > 0 or (a > 0 and b < 0):
		return (-abs(a), abs(b))
	return (abs(a), abs(b))
allcase = 0
ans = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			allcase += 1
		continue
	d = simple_fraction(-b[i], a[i])
	if d in dct:
		dct[d] += 1
		ans = max(ans, dct[d])
	else:
		dct[d] = 1
		ans = max(ans, 1)
print(allcase + ans)


from decimal import *
from collections import Counter
R = lambda : map(int, input().split())
n = int(input())
A = list(R())
B = list(R())
C = []
c = 0
for i in range(n):
	if A[i] == 0:
		if B[i] == 0:
			c += 1
		continue
	C.append(-(Decimal(B[i]) / Decimal(A[i])))
C = sorted(C)
d = Counter(C)
res = 0
for i in d:
	res = max(res, d[i])
print(res + c)


def gcd(x, y):
	if x == 0:
		return y
	if y == 0:
		return x
	if x > y:
		x %= y
		return gcd(x, y)
	else:
		y %= x
		return gcd(x, y)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = {}
ans = 0
for i in range(n):
	if a[i] < 0 and b[i] < 0:
		a[i] = -1 * a[i]
		b[i] = -1 * b[i]
	if a[i] < 0 and b[i] > 0:
		a[i] = -1 * a[i]
		b[i] = -1 * b[i]
	if a[i] == 0:
		if b[i] == 0:
			ans += 1
		else:
			continue
	elif b[i] == 0:
		s = '0'
		if s in c:
			c[s] += 1
		else:
			c[s] = 1
	else:
		y = abs(a[i])
		z = abs(b[i])
		g = gcd(y, z)
		a[i] //= g
		b[i] //= g
		s = str(a[i]) + 'a' + str(b[i])
		if s in c:
			c[s] += 1
		else:
			c[s] = 1
j = 0
for i in c:
	if c[i] > j:
		j = c[i]
print(ans + j)


from math import gcd
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
s = dict()
S = 0
Max = 0
for i in range(n):
	(a, b) = (A[i], B[i])
	if a == 0:
		if b == 0:
			S += 1
	else:
		if b == 0:
			d = (0, 0)
		else:
			if a * b > 0:
				e = +1
			else:
				e = -1
			c = gcd(a, b)
			a //= c
			b //= c
			a = e * abs(a)
			b = abs(b)
			d = (a, b)
		if d in s:
			s[d] += 1
			Max = max(Max, s[d])
		else:
			s[d] = 1
			Max = max(Max, 1)
print(Max + S)


import sys, math
readline = sys.stdin.readline
n = int(readline())
a = [int(x) for x in readline().split()]
b = [int(x) for x in readline().split()]
z = 0

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
dd = []
for i in range(n):
	if a[i] != 0:
		s = math.copysign(1, a[i]) * math.copysign(1, b[i])
		a[i] = abs(a[i])
		b[i] = abs(b[i])
		t = gcd(a[i], b[i])
		b[i] //= t
		a[i] //= t
		b[i] *= s
		dd.append(str(int(b[i])) + str(int(a[i])))
	elif b[i] == 0:
		z += 1
dd.sort()
mimax = 1
mamax = 1
for i in range(len(dd) - 1):
	if dd[i] == dd[i + 1]:
		mimax += 1
	else:
		if mimax > mamax:
			mamax = mimax
		mimax = 1
print(min(max(mamax, mimax), len(dd)) + z)


from decimal import *
getcontext().prec = 19
n = int(input())
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
d = {}
added = 0
for i in range(n):
	if a[i] != 0:
		d[Decimal(-b[i]) / Decimal(a[i])] = d.get(Decimal(-b[i]) / Decimal(a[i]), 0) + 1
	elif b[i] == 0:
		added = added + 1
values = d.values()
if len(values) != 0:
	print(max(d.values()) + added)
else:
	print(added)


import sys, io, os
from collections import defaultdict
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

class Fraction:

	def __init__(self, num=0, den=1):
		g = gcd(num, den)
		self.num = num // g
		self.den = den // g

	def __add__(self, other):
		num = self.num * other.den + other.num * self.den
		den = self.den * other.den
		g = gcd(num, den)
		return Fraction(num // g, den // g)

	def __sub__(self, other):
		num = self.num * other.den - other.num * self.den
		den = self.den * other.den
		g = gcd(num, den)
		return Fraction(num // g, den // g)

	def __mul__(self, other):
		num = self.num * other.num
		den = self.den * other.den
		g = gcd(num, den)
		return Fraction(num // g, den // g)

	def __truediv__(self, other):
		num = self.num * other.den
		den = self.den * other.num
		g = gcd(num, den)
		return Fraction(num // g, den // g)

	def __floordiv__(self, other):
		return self.num * other.den // (self.den * other.num)

	def __pow__(self, other):
		return Fraction(self.num ** other, self.den ** other)

	def __bool__(self):
		return bool(self.num)

	def __float__(self):
		return self.num / self.den

	def __abs__(self):
		return self if self.num >= 0 else Fraction(-self.num, self.den)

	def __neg__(self):
		return Fraction(-self.num, self.den)

	def __round__(self, ndigits=None):
		return round(self.num / self.den, ndigits)

	def __copy__(self):
		return Fraction(self.num, self.den)

	def __hash__(self):
		return hash((self.num, self.den))

	def __eq__(self, other):
		return (self.num, self.den) == (other.num, other.den)

	def __ne__(self, other):
		return not self == other

	def __ge__(self, other):
		pass

	def __gt__(self, other):
		pass

	def __le__(self, other):
		pass

	def __lt__(self, other):
		pass

	def from_float(self, num):
		pass

	def limit_denominator(self, limit):
		pass

def main():
	n = int(input())
	A = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	votes = defaultdict(int)
	g = 0
	for i in range(n):
		a = A[i]
		b = B[i]
		if b == 0 and a == 0:
			g += 1
		elif b == 0:
			votes[Fraction(0)] += 1
		elif a == 0:
			pass
		else:
			votes[Fraction(a, b)] += 1
	print(max([votes[v] for v in votes] or [0]) + g)
main()


from fractions import Fraction
from collections import Counter
inf = 10 ** 9 + 7
n = int(input())
a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]
d = []
zeros = 0
for i in range(n):
	if a[i] != 0:
		d.append(Fraction(-b[i], a[i]))
	elif b[i] == 0:
		zeros += 1
de = Counter(d)
if de == {}:
	print(0 + zeros)
else:
	ans = max(list(de.values())) + zeros
	print(ans)


from collections import Counter
from fractions import Fraction
(n, k, c) = (int(input()), 0, Counter({'f': 0}))
(*a,) = map(int, input().split())
(*b,) = map(int, input().split())
for i in range(n):
	if a[i] and b[i]:
		c[Fraction(a[i], b[i])] += 1
	elif a[i]:
		c[0] += 1
	elif not b[i]:
		k += 1
print(c.most_common(1)[0][1] + k)


from math import *
from sys import *
from heapq import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def graph_as_tree_1_root():
	n = int(input())
	dict = defaultdict(list)
	for _ in range(n - 1):
		(x, y) = list(map(int, input().split()))
		dict[x].append(y)
		dict[y].append(x)
	tree = [[1]]
	temp = [1]
	vall = 0
	seen = set([i for i in range(2, n + 1)])
	lol = []
	while len(seen) > 0:
		lol = list(seen)
		tt = []
		for x in temp:
			aa = []
			for val in dict[x]:
				if val in seen:
					aa += [val]
					seen.remove(val)
			dict[x] = aa
			tt += aa
		tree.append(tt)
		temp = tt
		vall += 1
	for x in lol:
		dict[x] = []
	print(tree, dict)

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	dict = defaultdict(int)
	val = 0
	for i in range(n):
		fl = 0
		if a[i] * b[i] > 0:
			fl = 1
		else:
			fl = -1
		a[i] = abs(a[i])
		b[i] = abs(b[i])
		if a[i] != 0:
			gd = gcd(a[i], b[i])
			a[i] //= gd
			b[i] //= gd
			dict[fl, b[i], a[i]] += 1
		if a[i] == 0 and b[i] == 0:
			val += 1
	if len(dict) == 0:
		print(val)
	else:
		print(val + max(list(dict.values())))
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def main():
	n = int(input())
	a = [int(x) for x in input().split(' ')]
	b = [int(x) for x in input().split(' ')]
	counts = {}
	jokers = 0
	for i in range(n):
		ai = a[i]
		bi = b[i]
		if ai == 0 and bi == 0:
			jokers += 1
			continue
		elif ai == 0 and bi != 0:
			continue
		if ai != 0 and bi == 0:
			key = '0/1'
		else:
			gcd = find_gcd(abs(ai), abs(bi))
			nom = -bi // gcd
			den = ai // gcd
			if nom < 0 and den > 0 or (nom > 0 and den < 0):
				nom = -abs(nom)
				den = abs(den)
			elif nom < 0 and den < 0:
				nom = abs(nom)
				den = abs(den)
			key = str(nom) + '/' + str(den)
		if key in counts:
			counts[key] += 1
		else:
			counts[key] = 1
	values = counts.values()
	if len(values) == 0:
		print(jokers)
	else:
		print(max(values) + jokers)

def find_gcd(a, b):
	if a == b:
		return a
	if a < b:
		(a, b) = (b, a)
	while True:
		r = a % b
		if r == 0:
			return b
		(a, b) = (b, r)
main()


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
mx = 0
count0 = 0
count = 0
no = 0
zn = []
for i in range(n):
	if a[i] == b[i] == 0:
		count += 1
	elif a[i] != 0:
		if b[i] == 0:
			count0 += 1
		elif b[i] < 0 and a[i] < 0 or (a[i] > 0 and b[i] > 0):
			zn.append(-1)
			c.append((abs(b[i]), abs(a[i])))
		else:
			zn.append(1)
			c.append((abs(b[i]), abs(a[i])))
	else:
		no += 1

def gcd(x, y):
	if x > y:
		if y == 0:
			return x
		return gcd(y, x % y)
	else:
		if x == 0:
			return y
		return gcd(x, y % x)
dic = {}
for i in range(n - count0 - count - no):
	(y, x) = (c[i][0], c[i][1])
	d = gcd(y, x)
	dr = (zn[i] * y // d, x // d)
	if dr in dic.keys():
		dic[dr] += 1
	else:
		dic.update({dr: 1})
if dic != {}:
	print(max(count0, max(dic.values())) + count)
else:
	print(count0 + count)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
p = 0
a = list(map(int, input().split()))
b = list(map(int, input().split()))
from collections import defaultdict
c = defaultdict(int)
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			p = p + 1
	else:
		while True:
			k = gcd(a[i], b[i])
			a[i] = a[i] // k
			b[i] = b[i] // k
			if k == 1 or k == -1:
				break
		c[a[i], b[i]] += 1
l = 0
for i in c:
	if c[i] > l:
		l = c[i]
print(l + p)


from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
zeros = 0
freqset = set()
freqdict = dict()
for i in range(n):
	if a[i] == 0 and b[i] != 0:
		continue
	elif a[i] == 0 and b[i] == 0:
		zeros += 1
		continue
	else:
		c = gcd(a[i], b[i])
		(b[i], a[i]) = (b[i] // c, a[i] // c)
	if (b[i], a[i]) not in freqset:
		freqset.add((b[i], a[i]))
		freqdict[b[i], a[i]] = 1
	else:
		freqdict[b[i], a[i]] += 1
r = freqdict.values()
if len(r) == 0:
	print(0 + zeros)
else:
	print(max(r) + zeros)


def arr_scan(line):
	return list(map(int, line.split(' ')))
import sys
from math import gcd
lines = sys.stdin.readlines()
n = int(lines[0])
a = arr_scan(lines[1])
b = arr_scan(lines[2])
d = 0
always = 0
most = {}
for (i, j) in zip(a, b):
	if i == 0 or j == 0:
		if i == 0 and j == 0:
			always += 1
		elif j == 0:
			d += 1
		continue
	gcd_ = gcd(i, j)
	i /= gcd_
	j /= gcd_
	if j < 0:
		j *= -1
		i *= -1
	tmp = (i, j)
	if tmp in most:
		most[tmp] += 1
	else:
		most[tmp] = 1
if len(most.values()) == 0:
	print(0 + d + always)
else:
	maxi = max(most.values())
	if d > maxi:
		maxi = d
	print(maxi + always)


from collections import Counter
from math import *
n = int(input())
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
dic = {}
res = 0
maxi = 0
zeros = []
for i in range(n):
	if a[i] != 0:
		div = gcd(a[i], b[i])
		t1 = a[i]
		t2 = b[i]
		if t1 < 0:
			(t1, t2) = (-t1, -t2)
		t1 = t1 // div
		t2 = t2 // div
		tup = (t2, t1)
		if tup not in dic:
			dic[tup] = 0
		dic[tup] += 1
		maxi = max(maxi, dic[tup])
	elif b[i] == 0:
		res += 1
try:
	print(res + max(dic.values()))
except ValueError:
	print(res)


import os, sys
mod = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_left
from math import sqrt, ceil, gcd
from _collections import deque
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = dict()
ans = 0
for i in range(n):
	if b[i] == 0 and a[i] == 0:
		ans += 1
	elif a[i]:
		t = gcd(a[i], b[i])
		a[i] //= t
		b[i] //= t
		b[i] *= -1
		if a[i] < 0:
			a[i] *= -1
			b[i] *= -1
		d[b[i], a[i]] = d.get((b[i], a[i]), 0) + 1
ck = 0
for i in d:
	ck = max(ck, d[i])
print(ans + ck)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
w = 0
for i in range(n):
	if a[i] != 0:
		c = gcd(abs(a[i]), abs(b[i]))
		z = 1
		if a[i] * b[i] < 0:
			z = -1
		d[abs(b[i]) // c, abs(a[i]) // c, z] = d.get((abs(b[i]) // c, abs(a[i]) // c, z), 0) + 1
	elif b[i] == 0:
		w += 1
mx = 0
for c in d:
	x = d[c]
	if x > mx:
		mx = x
print(int(mx) + w)


import sys
from math import gcd

def rint():
	return map(int, sys.stdin.readline().split())
n = int(input())
aa = list(rint())
bb = list(rint())
r = dict()
zz = 0
for i in range(n):
	a = aa[i]
	b = bb[i]
	if a == 0 and b != 0:
		continue
	if a == 0 and b == 0:
		zz += 1
		continue
	if a * b < 0:
		sign = -1
	else:
		sign = 1
	a = abs(a)
	b = abs(b)
	g = gcd(a, b)
	if g == 0:
		tmp = (0, 0)
	else:
		tmp = (sign * a // g, b // g)
	if tmp in r:
		r[tmp] = r[tmp] + 1
	else:
		r[tmp] = 1
if len(r):
	key = max(r, key=r.get)
	print(r[key] + zz)
else:
	print(zz)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	n = scanner()
	a = get_list()
	b = get_list()
	freq = {}
	ans = 0
	m = 0
	for (x, y) in zip(a, b):
		if x == 0:
			if y == 0:
				ans += 1
		else:
			d = -Decimal(y) / Decimal(x)
			c = freq.get(d, 0)
			freq[d] = c + 1
	if len(freq.values()) > 0:
		m = max(freq.values())
	print(ans + m)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cd = {0: 0}
x = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		x += 1
	elif a[i] != 0:
		f = Decimal(-b[i]) / Decimal(a[i])
		if f in cd:
			cd[f] += 1
		else:
			cd[f] = 1
print(max(cd.values()) + x)


def gcd(x, y):
	if x < y:
		return gcd(y, x)
	if y == 0:
		return x
	return gcd(y, x % y)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
for (i, j) in zip(a, b):
	if j == 0:
		if i == 0:
			d[0, 0] = d.get((0, 0), 0) + 1
		else:
			d[1, 0] = d.get((1, 0), 0) + 1
		continue
	if i == 0:
		continue
	g = gcd(abs(i), abs(j))
	x = i // g
	y = j // g
	if x < 0:
		x *= -1
		y *= -1
	d[x, y] = d.get((x, y), 0) + 1
ans = 0
for i in d.keys():
	if i == (0, 0):
		continue
	ans = max(ans, d[i])
print(ans + d.get((0, 0), 0))


import fractions

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	d = {0: 0}
	zt = 0
	for i in range(n):
		if a[i]:
			q = fractions.Fraction(-b[i], a[i])
			if q not in d:
				d[q] = 1
			else:
				d[q] += 1
		else:
			zt += b[i] == 0
	print(max(d.values()) + zt)
main()


from collections import Counter
from fractions import Fraction
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
cnt = 0
for i in range(n):
	if a[i] != 0:
		c.append(Fraction(-b[i], a[i]))
	elif a[i] == 0:
		if b[i] == 0:
			cnt += 1
d = Counter(c)
try:
	cnt += max(d.values())
	print(cnt)
except:
	print(cnt)


from collections import Counter
from fractions import Fraction
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
D = []
indef_num = 0
for (a, b) in zip(A, B):
	if a == 0:
		if b == 0:
			indef_num += 1
		continue
	D.append(Fraction(-b, a))
if not D:
	print(indef_num)
else:
	d = Counter(D).most_common()
	print(D.count(d[0][0]) + indef_num)


from decimal import *
R = lambda : map(int, input().split())
n = int(input())
A = list(R())
B = list(R())
C = []
c = 0
for i in range(n):
	if A[i] == 0:
		if B[i] == 0:
			c += 1
		continue
	C.append(-(Decimal(B[i]) / Decimal(A[i])))
C = sorted(C)
(i, j) = (0, 0)
res = 0
l = len(C)
while j < l:
	while j < l and C[i] == C[j]:
		j += 1
	res = max(res, j - i)
	i = j
print(res + c)


def gcd(a, b):
	while a % b != 0:
		a %= b
		(a, b) = (b, a)
	return b
t = int(input())
sp = list(map(int, input().split()))
sp1 = list(map(int, input().split()))
d = dict()
r = 0
for i in range(t):
	if sp[i] == 0:
		if sp1[i] == 0:
			r += 1
		continue
	f = gcd(sp1[i], sp[i])
	f = [sp1[i] // f, sp[i] // f]
	if f[0] < 0:
		f[0] = -f[0]
		f[1] = -f[1]
	f = (f[0], f[1])
	if f in d:
		d[f] += 1
	else:
		d[f] = 1
p = 0
for i in d:
	if d[i] > p:
		p = d[i]
print(p + r)


def nod(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = {}
l = 0
for i in range(n):
	(a, b) = (A[i], B[i])
	if not (a == 0 and b != 0):
		if a == 0:
			l += 1
		else:
			x = max(abs(a), abs(b))
			y = min(abs(a), abs(b))
			Nod = nod(x, y)
			g = 1
			if a * b < 0:
				g = -1
			a = abs(a) * g // Nod
			b = abs(b) // Nod
			if a not in C:
				C[a] = {}
			if b not in C[a]:
				C[a][b] = 0
			C[a][b] += 1
ma = 0
for i in C:
	for j in C[i]:
		if C[i][j] > ma:
			ma = C[i][j]
print(ma + l)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from collections import defaultdict as dd
(n,) = I()
a = I()
b = I()
d = dd(int)
d[0] = 0
ans = 0
for i in range(n):
	if a[i]:
		d[-b[i] * 10000000000.0 / a[i]] += 1
	elif b[i] == 0:
		ans += 1
print(ans + max(d.values()))


from decimal import *
getcontext().prec = 28
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
x = []
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ans += 1
		continue
	x.append(-Decimal(b[i]) / Decimal(a[i]))
mp = {}
for i in x:
	if i in mp:
		mp[i] += 1
	else:
		mp[i] = 1
aux = 0
for i in mp:
	aux = max(aux, mp[i])
print(ans + aux)


from collections import *
from fractions import *
R = lambda : map(int, input().split())
input()
a = [*zip(R(), R())]
print((Counter((Fraction(y, x) for (x, y) in a if x)).most_common(1) or [(0, 0)])[0][1] + sum((x == y == 0 for (x, y) in a)))


from math import gcd
from collections import defaultdict

def factor(x, y):
	if y < 0:
		(x, y) = (-x, -y)
	g = gcd(x, y)
	return (x // g, y // g)

def solve(a, b):
	d = defaultdict(int)
	base = 0
	for (x, y) in zip(a, b):
		if (x, y) == (0, 0):
			base += 1
		elif y == 0:
			d[0, 0] += 1
		elif x == 0:
			continue
		else:
			d[factor(x, y)] += 1
	print(max(d.values(), default=0) + base)

def solve_from_stdin():
	input()
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	solve(a, b)
solve_from_stdin()


def gcd(a, b):
	if a == 0 or b == 0:
		return a + b
	if a > b:
		return gcd(a % b, b)
	elif b > a:
		return gcd(b % a, a)
	else:
		return a

def reduce(fraction):
	if fraction[0] == 0 and fraction[1] != 0:
		return 0
	elif fraction[0] == 0 and fraction[1] == 0:
		return (0, 0)
	elif fraction[0] != 0 and fraction[1] == 0:
		return None
	(numerator, denominator) = fraction
	neg = (numerator < 0) != (denominator < 0)
	numerator = abs(numerator)
	denominator = abs(denominator)
	g = gcd(numerator, denominator)
	numerator /= g
	denominator /= g
	return (numerator, denominator) if not neg else (-numerator, denominator)
n = int(input())
a = [int(num) for num in input().split(' ')]
b = [int(num) for num in input().split(' ')]
fractionCount = {}
fractionCount[0, 0] = 0
for i in range(n):
	fraction = reduce((b[i], a[i]))
	if fraction != None:
		if fraction in fractionCount:
			fractionCount[fraction] += 1
		else:
			fractionCount[fraction] = 1
maxCount = 0
for (fraction, count) in fractionCount.items():
	if count > maxCount and fraction != (0, 0):
		maxCount = count
print(maxCount + fractionCount[0, 0])


from fractions import gcd
x = input()
x = input()
a_s = []
for i in x.split():
	a_s.append(int(i))
x = input()
b_s = []
tmp1 = 0
tmp2 = 0
for i in x.split():
	b_s.append(int(i))
pairs = []
for i in range(len(a_s)):
	if a_s[i] != 0 and b_s[i] != 0:
		tmp_gcd = gcd(-b_s[i], a_s[i])
		pairs.append((-b_s[i] / tmp_gcd, a_s[i] / tmp_gcd))
	elif a_s[i] == 0 and b_s[i] == 0:
		tmp2 += 1
pair_map = {}
for i in pairs:
	if i in pair_map:
		pair_map[i] += 1
	else:
		pair_map[i] = 1
ans = 0
for i in pair_map.values():
	ans = max(ans, i)
map_tmp = {}
for i in range(len(a_s)):
	if b_s[i] == 0:
		tmp1 += 1
print(max(ans + tmp2, tmp1))


from collections import Counter
import decimal as d
n = int(input())
a = (d.Decimal(i) for i in input().split())
b = (d.Decimal(i) for i in input().split())
x = Counter()
extra = 0
d.getcontext().prec = 28
for (i, j) in zip(a, b):
	try:
		x[j / i] += 1
	except d.InvalidOperation:
		extra += 1
	except d.DivisionByZero:
		pass
try:
	print(x.most_common(1)[0][1] + extra)
except IndexError:
	print(0 + extra)


def gcd(a, b):
	(a, b) = (abs(a), abs(b))
	while b > 0:
		(a, b) = (b, a % b)
	return a
kk = lambda : map(int, input().split())
ll = lambda : list(kk())
(n, a, b, c, d, m) = (int(input()), ll(), ll(), 0, {0: 0}, 0)
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			c += 1
	elif b[i] == 0:
		d[0] += 1
		if d[0] > m:
			m = d[0]
	else:
		g = gcd(a[i], b[i])
		t = (abs(a[i] // g), abs(b[i] // g), (int(a[i] < 0) + int(b[i] < 0)) % 2)
		if t not in d:
			d[t] = 0
		d[t] += 1
		if d[t] > m:
			m = d[t]
print(m + c)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = dict()
e = 0
for i in range(n):
	if a[i] == b[i] == 0:
		e += 1
	elif a[i] != 0:
		p = math.gcd(b[i], a[i])
		x = b[i] // p
		y = a[i] // p
		if y < 0:
			y *= -1
			x *= -1
		if x == 0:
			y = 0
		if (x, y) not in d:
			d.update({(x, y): 1})
		else:
			d[x, y] += 1
if len(d) == 0:
	print(e)
else:
	print(max(d.values()) + e)


n = int(input())
from collections import Counter
from math import gcd
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = []
for i in range(n):
	l.append(gcd(abs(a[i]), abs(b[i])))
c = []
d = []
z = 0
for i in range(n):
	if a[i] != 0:
		if b[i] != 0:
			if a[i] * b[i] < 0:
				c.append((-abs(a[i] // l[i]), abs(b[i] // l[i])))
			else:
				c.append((abs(a[i] // l[i]), abs(b[i] // l[i])))
		else:
			c.append(0)
	if b[i] != 0 and a[i] != 0:
		if a[i] * b[i] < 0:
			d.append((-abs(b[i] // l[i]), abs(a[i] // l[i])))
		else:
			d.append((abs(b[i] // l[i]), abs(a[i] // l[i])))
	if a[i] == 0 and b[i] == 0:
		z += 1
if len(c) == 0:
	print(0 + z)
else:
	c1 = Counter(c)
	c2 = Counter(d)
	ans1 = 1
	ans2 = 1
	for (x, y) in c1.most_common(1):
		ans1 = y
	for (x, y) in c2.most_common(1):
		ans2 = y
	print(max(ans1, ans2) + z)


import collections
import math
input()
a = list(map(int, input().split()))
b = list(map(int, input().split()))
counts = collections.defaultdict(int)
arbitrary = 0
for (ai, bi) in zip(a, b):
	if ai == 0:
		if bi == 0:
			arbitrary += 1
	elif bi == 0:
		counts[0, 0] += 1
	else:
		if ai < 0 and bi < 0 or (ai >= 0 and bi < 0):
			ai = -ai
			bi = -bi
		g = math.gcd(-bi, ai)
		counts[-bi // g, ai // g] += 1
if counts:
	print(max(counts.values()) + arbitrary)
else:
	print(arbitrary)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(d, k) = ({}, 0)
from math import gcd
for (i, x) in enumerate(a):
	y = b[i]
	if x == 0:
		if y == 0:
			k += 1
		continue
	item = gcd(x, y)
	x = x // item
	y = y // item
	(x1, y1) = (-x, -y)
	if d.get((x, y)) == None:
		if d.get((x1, y1)) == None:
			d[x, y] = 1
		else:
			d[x1, y1] += 1
	else:
		d[x, y] += 1
if d == {}:
	print(0 + k)
else:
	print(max(d.values()) + k)


from sys import stdin, stdout
input = stdin.readline

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = 1
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	dict = {}
	m = 0
	c = 0
	for i in range(n):
		if a[i] != 0:
			x = -b[i]
			y = a[i]
			v = gcd(x, y)
			x //= v
			y //= v
			if x < 0 and y < 0:
				x = abs(x)
				y = abs(y)
			elif x < 0 or y < 0:
				x = -abs(x)
				y = abs(y)
			d = (x, y)
			if d in dict:
				dict[d] += 1
			else:
				dict[d] = 1
		elif b[i] == 0:
			c += 1
	for i in dict:
		m = max(m, dict[i] + c)
	print(max(m, c))


from fractions import Fraction
import collections
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
abzero = 0
bzero = 0
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			abzero += 1
	elif b[i] == 0:
		bzero += 1
	else:
		c.append(Fraction(a[i], b[i]).limit_denominator(1000000000))
c = collections.Counter(c)
try:
	ma = c.most_common()[0][1]
except IndexError:
	ma = 0
print(max(ma + abzero, abzero + bzero))


from sys import stdin
from collections import *
from decimal import *

def arr_inp(n):
	if n == 1:
		return [int(x) for x in stdin.readline().split()]
	elif n == 2:
		return [float(x) for x in stdin.readline().split()]
	else:
		return list(stdin.readline()[:-1])
(n, a1, a2, ans, mem) = (int(input()), arr_inp(1), arr_inp(1), 0, Counter())
for i in range(n):
	try:
		mem[-(Decimal(str(a2[i])) / a1[i])] += 1
	except:
		if a1[i] == a2[i] == 0:
			ans += 1
		elif a2[i] == 0:
			mem[0] += 1
for (i, j) in mem.most_common():
	ans += j
	break
print(ans)


from collections import Counter, defaultdict, deque
from operator import itemgetter
import math
import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	arr1 = [int(x) for x in input().split()]
	arr2 = [int(x) for x in input().split()]
	d = defaultdict(int)
	z = 0
	p = 0
	d[0, 0] = 0
	for i in range(n):
		a = arr1[i]
		b = arr2[i]
		if a == 0:
			if b == 0:
				z += 1
			continue
		g = math.gcd(a, b)
		a //= g
		b //= g
		if a < 0:
			a *= -1
			b *= -1
		t = (a, b)
		d[t] += 1
	print(max(d.values()) + z)
tt = 1
for test in range(tt):
	solve()


def gcd(x, y):
	if y:
		return gcd(y, x % y)
	return x
n = int(input())
ans = 0
c = {}
for (x, y) in zip(map(int, input().split()), map(int, input().split())):
	if not x:
		if not y:
			ans += 1
	else:
		g = gcd(abs(x), abs(y))
		x //= g
		y //= g
		if x < 0:
			x = -x
			y = -y
		p = (x, y)
		c[p] = c.get(p, 0) + 1
if c:
	ans += max(c.values())
print(ans)


from collections import defaultdict
from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = defaultdict(int)
tmp = 0
plus = 0
ans = 0
for i in range(n):
	if b[i] == 0:
		tmp += 1
		if a[i] == 0:
			plus += 1
	else:
		if a[i] == 0:
			continue
		g = gcd(a[i], b[i])
		(x, y) = (b[i] // g, a[i] // g)
		if x * y > 0:
			(x, y) = (abs(x), abs(y))
		else:
			(x, y) = (abs(x), -abs(y))
		d[x, y] += 1
		ans = max(ans, d[x, y])
if len(d):
	print(max(ans + plus, tmp))
else:
	print(max(tmp, 0))


def solution():
	from decimal import Decimal
	n = int(input())
	a = list(map(Decimal, input().split()))
	b = list(map(Decimal, input().split()))
	d = {}
	cnt = 0
	m = 0
	for i in range(n):
		if a[i] == 0:
			if b[i] == 0:
				cnt += 1
			continue
		else:
			x = b[i] / a[i]
			d[x] = d.get(x, 0) + 1
			m = max(m, d.get(x, 0))
	print(cnt + m)
solution()


inf = 2000000000

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)

def reduce(b, a):
	if b == 0 and a == 0:
		return (0, 0)
	if b < 0:
		(a, b) = (-a, -b)
	elif b == 0 and a < 0:
		a = -a
	g = gcd(abs(a), abs(b))
	return (b // g, a // g)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = sorted([reduce(-b[i], a[i]) for i in range(n)])
z = c.count((0, 0))
c = [t for t in c[z:] if t[1] != 0]
maxcnt = 0
if len(c) != 0:
	c.append((inf, inf))
	maxcnt += 1
	cnt = 1
	for i in range(1, len(c)):
		if c[i] == c[i - 1]:
			cnt += 1
		else:
			if cnt > maxcnt:
				maxcnt = cnt
			cnt = 1
print(z + maxcnt)


n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
D = []
ANS = 0
for i in range(n):
	if A[i] == 0 and B[i] == 0:
		ANS += 1
	elif A[i] == 0 and B[i] != 0:
		continue
	elif A[i] != 0 and B[i] == 0:
		D.append(0)
	else:
		D.append((A[i] // gcd(A[i], B[i]), B[i] // gcd(A[i], B[i])))
from collections import Counter
C = Counter(D)
if len(C) == 0:
	print(ANS)
else:
	print(ANS + max(C.values()))


from decimal import *
n = int(input())
a = list(map(Decimal, input().split()))
b = list(map(Decimal, input().split()))
d = dict()
count = ts = 0
for i in range(n):
	if a[i] != 0:
		xs = -(b[i] / a[i])
		if xs not in d:
			d[xs] = 0
		d[xs] += 1
	elif b[i] == 0:
		ts += 1
for i in d.keys():
	count = max(count, d[i])
print(count + ts)


from math import gcd
from collections import Counter as C
n = int(input())
a = [*map(int, input().split())]
b = [*map(int, input().split())]
l = []
res = 0
for i in range(n):
	if a[i] != 0:
		s = 1 if a[i] * b[i] > 0 else -1
		a[i] = abs(a[i])
		b[i] = abs(b[i])
		g = gcd(a[i], b[i])
		a[i] //= g
		b[i] //= g
		l.append((s * abs(a[i]), abs(b[i])))
	elif b[i] == 0:
		res += 1
if len(l):
	res += C(l).most_common(1)[0][1]
print(res)


from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(z, ans) = (0, 0)
d = {}
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			z += 1
	else:
		dr = Decimal(-b[i]) / Decimal(a[i])
		d[dr] = d.get(dr, 0) + 1
		ans = max(ans, d[dr])
print(ans + z)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
from collections import defaultdict

def lcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
c = [0] * n
nums = defaultdict(int)
res_max = 0
res_zero = 0
for i in range(n):
	if a[i] == 0:
		if not b[i]:
			res_zero += 1
		continue
	r = -b[i] * 10000000000.0 / a[i]
	nums[r] += 1
	res_max = max(res_max, nums[r])
print(res_max + res_zero)


import collections as col
import math, string
from functools import reduce
from random import randint

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	B = getInts()
	vals = col.defaultdict(int)
	ans = 0
	for i in range(N):
		if not A[i] and (not B[i]):
			ans += 1
		elif A[i]:
			if A[i] < 0 and B[i] < 0:
				A[i] *= -1
				B[i] *= -1
			elif A[i] < 0:
				A[i] *= -1
				B[i] *= -1
			g = math.gcd(A[i], B[i])
			vals[B[i] // g, A[i] // g] += 1
	best = 0
	for (key, val) in vals.items():
		best = max(best, val)
	return ans + best
print(solve())


from math import gcd
from collections import Counter
n = int(input())
li1 = list(map(int, input().split()))
li2 = list(map(int, input().split()))
c = 0
i = 0
while i < len(li1):
	if li1[i] and li2[i]:
		g = gcd(li1[i], li2[i])
		if li1[i] < 0 and li2[i] < 0:
			g *= -1
		if li1[i] > 0 and li2[i] < 0:
			g *= -1
		li1[i] //= g
		li2[i] //= g
		i += 1
	elif li1[i] and (not li2[i]):
		li1[i] = 1
		i += 1
	elif not li1[i] and (not li2[i]):
		c += 1
		li1.pop(i)
		li2.pop(i)
	elif not li1[i] and li2[i]:
		li1.pop(i)
		li2.pop(i)
li3 = []
for i in range(len(li1)):
	li3.append((li1[i], li2[i]))
if li3:
	dic = Counter(li3)
	tup = dic.items()
	lt = list(tup)
	lt.sort(key=lambda tup: -tup[1])
	c += lt[0][1]
print(c)


import math
input()
nums1 = list(map(int, input().split()))
nums2 = list(map(int, input().split()))
dic = {}
ma = 0
inc = 0
for i in range(len(nums1)):
	if nums1[i] == 0:
		if nums2[i] == 0:
			inc += 1
	else:
		g = math.gcd(nums2[i], nums1[i])
		num = (nums2[i] // g, nums1[i] // g)
		if num[1] < 0:
			num = (-1 * num[0], -1 * num[1])
		if num in dic:
			dic[num] += 1
			ma = max(dic[num], ma)
		else:
			dic[num] = 1
			ma = max(1, ma)
print(ma + inc)


from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
m = {}
z = 0
for i in range(n):
	if b[i] != 0 and a[i] != 0 or (b[i] == 0 and a[i] != 0):
		g = gcd(b[i], a[i])
		el = (b[i] // g, a[i] // g)
		if el in m:
			m[el] += 1
		else:
			m[el] = 1
	elif b[i] == a[i] == 0:
		z += 1
print(max(m.values()) + z if m else z if z else 0)


import sys, math
gcd = math.gcd
sys.setrecursionlimit(1000000)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
dsp = {0: 0}
dsn = {0: 0}
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		ans += 1
	elif b[i] == 0:
		dsp[0] += 1
		dsn[0] += 1
	elif a[i] != 0 and b[i] != 0:
		ai = abs(a[i])
		bi = abs(b[i])
		gab = gcd(ai, bi)
		ai = ai // gab
		bi = bi // gab
		k = str(ai) + '.' + str(bi)
		if a[i] * b[i] < 0:
			if k in dsn:
				dsn[k] += 1
			else:
				dsn[k] = 1
		elif k in dsp:
			dsp[k] += 1
		else:
			dsp[k] = 1
ans += max(max(dsp.values()), max(dsn.values()))
print(ans)


def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(d, zeros) = ({0: 0}, 0)
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			zeros += 1
		continue
	gi = gcd(a[i], b[i])
	a[i] //= gi
	b[i] //= gi
	if a[i] < 0:
		a[i] *= -1
		b[i] *= -1
	if (a[i], b[i]) not in d:
		d[a[i], b[i]] = 0
	d[a[i], b[i]] += 1
print(max(d.values()) + zeros)


import math
import collections
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
counts = collections.defaultdict(int)
res = 0
for (x, y) in zip(a, b):
	if x == 0:
		if y == 0:
			res += 1
	elif y == 0:
		counts[0, 0] += 1
	else:
		s = 1
		if x * y < 0:
			s = -1
		x = abs(x)
		y = abs(y)
		k = math.gcd(x, y)
		counts[s * x // k, y // k] += 1
if counts:
	print(max(counts.values()) + res)
else:
	print(res)


a = int(input())
z = list(map(int, input().split()))
m = list(map(int, input().split()))
import math
from collections import defaultdict
al = defaultdict(int)
count = 0
maxa = 0
for i in range(len(z)):
	if z[i] == 0 and m[i] == 0:
		count += 1
	elif z[i] != 0:
		if z[i] > 0 and m[i] > 0 or (z[i] < 0 and m[i] < 0):
			z[i] = abs(z[i])
			m[i] = abs(m[i])
			al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])] += 1
			if al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])] > maxa:
				maxa = al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])]
		else:
			z[i] = abs(z[i])
			z[i] = -1 * z[i]
			m[i] = abs(m[i])
			al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])] += 1
			if al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])] > maxa:
				maxa = al[z[i] // math.gcd(z[i], m[i]), m[i] // math.gcd(z[i], m[i])]
print(maxa + count)


from decimal import *
from math import gcd
getcontext().prec = 25
n = int(input())
arr = list(map(int, input().split()))
brr = list(map(int, input().split()))
d = {}
cnt = 0
for i in range(n):
	x = gcd(arr[i], brr[i])
	if arr[i] == 0 and brr[i] == 0:
		cnt += 1
	elif arr[i] == 0 and brr[i] != 0:
		continue
	else:
		x = Decimal(brr[i]) / Decimal(arr[i])
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
m = 0
for i in d:
	m = max(m, d[i])
print(m + cnt)


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
int1 = lambda x: int(x) - 1

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
from decimal import *

def solve():
	(n,) = aj()
	A = aj()
	B = aj()
	C = Counter()
	count = 0
	getcontext().prec = 20
	for (i, j) in zip(A, B):
		if i == 0:
			if j == 0:
				count += 1
		else:
			v = Decimal(-j) / Decimal(i)
			C[v] += 1
	if C:
		print(count + max(C.values()))
	else:
		print(count)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
solve()


from sys import exit, setrecursionlimit
setrecursionlimit(10 ** 6)
inn = lambda : input().strip()
mapp_m1 = lambda : map(lambda x: int(x) - 1, inn().split(' '))
mapp = lambda : map(int, inn().split(' '))
N = int(inn())
A = list(mapp())
B = list(mapp())

def gcd(a, b):
	return gcd(b, a % b) if b != 0 else a
from collections import defaultdict
from fractions import Fraction
di = defaultdict(int)
default = 0
bzero = 0
for (a, b) in zip(A, B):
	if b == 0:
		if a == 0:
			default += 1
		else:
			bzero += 1
	elif a == 0:
		continue
	else:
		gcdd = gcd(a, b)
		di[a // gcdd, b // gcdd] += 1
answer = 0
for key in di:
	answer = max(answer, di[key])
answer = max(answer, bzero)
print(answer + default)


from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
divs = []
m = 0
ans = 0
for i in range(n):
	if a[i] != 0 and b[i] != 0:
		d = Decimal(b[i]) / Decimal(a[i])
		divs.append(d)
	if a[i] == 0 and b[i] == 0:
		ans += 1
	elif a[i] != 0 and b[i] == 0:
		divs.append(0)
divs.sort()
t = 10 ** 9 + 1
count = 0
for i in range(len(divs)):
	if divs[i] == t:
		count += 1
	else:
		t = divs[i]
		m = max(m, count)
		count = 1
m = max(m, count)
print(m + ans)


from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
dict1 = dict()
ans = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		ans += 1
	elif a[i] != 0:
		c = Decimal(-b[i]) / Decimal(a[i])
		if c in dict1:
			dict1[c] += 1
		else:
			dict1[c] = 1
max = 0
for items in dict1:
	if dict1[items] > max:
		max = dict1[items]
print(max + ans)


d = {}
mx = 0

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def divide(x, y):
	hcf = gcd(x, y)
	x //= hcf
	y //= hcf
	return str(x) + '-' + str(y)
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = 0
for i in range(n):
	if a[i] != 0:
		y = divide(-b[i], a[i])
		try:
			d[y] += 1
		except:
			d[y] = 1
		mx = max(mx, d[y])
	elif a[i] == 0 and b[i] == 0:
		c += 1
print(mx + c)


import math
n = int(input())
li1 = [int(k) for k in input().split()]
li2 = [int(j) for j in input().split()]
dic = {}
cnt = 0
max1 = 0
for i in range(n):
	if li1[i] == 0:
		if li2[i] == 0:
			cnt += 1
	else:
		a = -li2[i]
		b = li1[i]
		if a < 0:
			a *= -1
			b *= -1
		elif a == 0 and b < 0:
			b *= -1
		x = math.gcd(li2[i], li1[i])
		a = a / x
		b = b / x
		val = str(b) + str(a)
		if val not in dic:
			dic[val] = 0
		dic[val] += 1
		max1 = 0
for item in dic:
	max1 = max(dic[item], max1)
print(max1 + cnt)


import math
from collections import defaultdict

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
n = r()
c = rl()
e = rl()
ele = defaultdict(int)
zeros = 0
ans = 0

def normalize(a, b):
	if a < 0:
		a *= -1
		b *= -1
	elif a == 0 and b < 0:
		b *= -1
	d = math.gcd(abs(a), abs(b))
	a //= d
	b //= d
	return (a, b)
for i in range(n):
	if c[i] == 0:
		if e[i] == 0:
			zeros += 1
	else:
		(a, b) = normalize(-e[i], c[i])
		ele[a, b] += 1
if len(ele) == 0:
	print(zeros)
else:
	print(zeros + max(ele.values()))


import math
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
tabela = dict()
qualquer = 0
max_count = 0

def fracao(x, y):
	dividendo = x // math.gcd(x, y)
	divisor = y // math.gcd(x, y)
	if dividendo * divisor > 0:
		return (abs(dividendo), abs(divisor))
	else:
		return (-abs(dividendo), abs(divisor))
for i in range(n):
	a = A[i]
	b = B[i]
	if b == 0 and a == 0:
		qualquer += 1
	elif b == 0 and a != 0:
		if 0 not in tabela:
			tabela[0] = 0
		tabela[0] += 1
		max_count = max(max_count, tabela[0])
	elif b != 0 and a == 0:
		continue
	else:
		fracao_b_a = fracao(-b, a)
		if fracao_b_a not in tabela:
			tabela[fracao_b_a] = 0
		tabela[fracao_b_a] += 1
		max_count = max(max_count, tabela[fracao_b_a])
print(max_count + qualquer)


from math import gcd

def get_sign(_u, _b):
	if _u > 0 and _b > 0 or (_u < 0 and _b < 0):
		return ''
	else:
		return '-'
input()
u = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
acc = 0
reduced = []
extra = 0
for i in range(len(u)):
	_u = abs(u[i])
	_b = abs(b[i])
	sign = get_sign(u[i], b[i])
	if _u == 0 or _b == 0:
		if _u == 0 and _b == 0:
			acc += 1
			continue
		elif _u != 0 and _b == 0:
			extra += 1
			continue
		else:
			continue
	while True:
		_gcd = gcd(_u, _b)
		if _gcd == 1:
			break
		_u = _u // _gcd
		_b = _b // _gcd
	reduced.append(sign + str(_u) + ':' + str(_b))
m = {}
for i in range(len(reduced)):
	if reduced[i] in m:
		m[reduced[i]] += 1
	else:
		m[reduced[i]] = 1
_max = 0
for key in m:
	if m[key] > _max:
		_max = m[key]
print(max(acc + _max, acc + extra))


import math
n = int(input())
x = [*map(int, input().split())]
y = [*map(int, input().split())]
cnt = dict()
fixcnt = 0
zeroToCnt = 0
for i in range(n):
	if x[i] == 0:
		if y[i] == 0:
			fixcnt += 1
		continue
	if y[i] == 0:
		zeroToCnt += 1
		continue
	gc = math.gcd(x[i], y[i])
	(tx, ty) = (x[i] // gc, y[i] // gc)
	if tx * ty >= 0:
		si = True
	else:
		si = False
	cnt[abs(tx), abs(ty), si] = cnt.get((abs(tx), abs(ty), si), 0) + 1
cntRes = max(zeroToCnt, max(cnt.values() if cnt else [0]))
print(cntRes + fixcnt)


import math
n = int(input())
a = [int(x) for x in input().split(' ')]
b = [int(x) for x in input().split(' ')]
dp = dict()
x = 0
used = set()
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			x += 1
	else:
		q = math.gcd(a[i], b[i])
		if a[i] < 0:
			f = (b[i] // q, abs(a[i]) // q)
		else:
			f = (-b[i] // q, abs(a[i]) // q)
		if f in used:
			dp[f] += 1
		else:
			dp[f] = 1
			used.add(f)
ans = 0
for elem in dp:
	ans = max(ans, dp[elem])
ans += x
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import *
from operator import itemgetter, attrgetter
from decimal import *
import bisect
import math
import heapq as hq
ans = 0
n = int(input())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
compel = 0
m = {}

def norm(a, b):
	if a < 0:
		a = abs(a)
		b = b * -1
	elif a == 0 and b < 0:
		b = abs(b)
	d = math.gcd(abs(a), abs(b))
	a /= d
	b /= d
	if (a, b) not in m:
		m[a, b] = 1
	else:
		m[a, b] += 1
for i in range(n):
	if l1[i] == 0 and l2[i] == 0:
		compel += 1
	elif l1[i] == 0:
		continue
	else:
		norm(-l2[i], l1[i])
ans = m.values()
if len(ans):
	print(max(ans) + compel)
else:
	print(compel)


from collections import *
from fractions import *
R = lambda : map(int, input().split())
input()
a = [*zip(R(), R())]
print(max(0, 0, *Counter((Fraction(y, x) for (x, y) in a if x)).values()) + sum((x == y == 0 for (x, y) in a)))


import math as mt
from fractions import Fraction
from collections import Counter

def m(lst):
	data = Counter(lst)
	return data.most_common(1)[0][0]
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
p = 0
c = []
for i in range(n):
	if a[i] != 0:
		k = Fraction(b[i], a[i])
		c.append(k)
	elif a[i] == 0 and b[i] == 0:
		p += 1
if len(c) == 0:
	print(p)
else:
	print(c.count(m(c)) + p)


import math
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
(res, d) = (0, {})
for (a, b) in zip(A, B):
	if a != 0:
		gcd = a if b == 0 else math.gcd(a, b)
		key = (-b / a < 0, abs(b / gcd), abs(a / gcd))
		d[key] = d.get(key, 0) + 1
	elif b == 0:
		res += 1
vals = list(d.values())
if vals:
	print(res + max(vals))
else:
	print(res)


from decimal import Decimal
from collections import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = defaultdict(int)
ans = 0
value = 0
for i in range(n):
	if a[i] == 0 and b[i] != 0:
		continue
	if a[i] == 0 and b[i] == 0:
		ans += 1
		continue
	val = Decimal(b[i]) / Decimal(a[i])
	d[val] += 1
	value = max(value, d[val])
print(value + ans)


from fractions import Fraction
n = int(input())
a = list(map(int, input().strip().split()))
b = list(map(int, input().strip().split()))
extra_count = 0
counts_map = dict()
for (ai, bi) in zip(a, b):
	if ai != 0:
		fi = Fraction(-1 * bi, ai)
		num_i = fi.numerator
		den_i = fi.denominator
		curr_str = str(num_i) + '#' + str(den_i)
		if curr_str in counts_map:
			counts_map[curr_str] += 1
		else:
			counts_map[curr_str] = 1
	elif bi == 0:
		extra_count += 1
	else:
		pass
max = 0
for key in counts_map:
	curr_count = counts_map[key]
	if curr_count > max:
		max = curr_count
print(max + extra_count)


from collections import Counter
from fractions import Fraction
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = Counter()
r = 0
for i in range(n):
	if a[i] == 0 == b[i]:
		r += 1
		continue
	if a[i] == 0:
		continue
	c[Fraction(b[i], a[i])] += 1
r += c.most_common(1)[0][1] if len(c) > 0 else 0
print(r)


from collections import defaultdict

def gcd(a, b):
	if a % b == 0:
		return b
	return gcd(b, a % b)

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	e = defaultdict(int)
	cnt = 0
	for i in range(n):
		if a[i] == 0:
			if b[i] == 0:
				cnt += 1
			continue
		if b[i] == 0:
			e[0, 0] += 1
			continue
		w = gcd(a[i], b[i])
		wa = a[i] / w
		wb = b[i] / w
		e[wa, wb] += 1
	ans = 0
	for i in e.values():
		ans = max(ans, i)
	print(cnt + ans)
main()


from fractions import Fraction
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = {}
ans = 0
zeros = 0
for i in range(n):
	if A[i] == 0 and B[i] != 0:
		continue
	elif A[i] == 0 and B[i] == 0:
		zeros += 1
	else:
		temp = Fraction(abs(B[i]), abs(A[i]))
		if A[i] > 0 and B[i] > 0:
			temp *= -1
		elif A[i] < 0 and B[i] < 0:
			temp *= -1
		temp = str(temp)
		if temp not in count:
			count[temp] = 1
		else:
			count[temp] += 1
		ans = max(ans, count[temp])
print(ans + zeros)


import math
from collections import defaultdict as dd

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = [int(i) for i in input().split(' ')]
b = [int(i) for i in input().split(' ')]
e = 0
d = dd(int)
d[-1] = 0
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		e += 1
	elif a[i] != 0:
		x = gcd(a[i], b[i])
		a[i] //= x
		b[i] //= x
		d[a[i], b[i]] += 1
print(max(d.values()) + e)


from math import gcd

def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	b = [int(i) for i in input().split(' ')]
	d = {}
	m = 0
	z = 0
	for i in range(n):
		if a[i] == 0 and b[i] == 0:
			z += 1
		elif a[i] == 0:
			continue
		elif b[i] == 0:
			d.setdefault(0, 0)
			d[0] += 1
			m = max(m, d[0])
		else:
			g = gcd(a[i], b[i])
			b_m = b[i] // g
			a_m = a[i] // g
			sign = '-' if b_m // a_m < 0 else '+'
			b_m = abs(b_m)
			a_m = abs(a_m)
			d.setdefault((sign, b_m, a_m), 0)
			d[sign, b_m, a_m] += 1
			m = max(m, d[sign, b_m, a_m])
	return m + z
print(go())


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = {}
count = 0
for i in range(n):
	if a[i] != 0:
		t = -b[i] * 10000000000.0 / a[i]
		if t in c:
			c[t] += 1
		else:
			c[t] = 1
	elif b[i] == 0:
		count += 1
d = list(c.values())
if len(d) > 0:
	print(count + max(d))
else:
	print(count)


n = int(input())
l = list(map(int, input().strip().split()))
m = list(map(int, input().strip().split()))

def gcd(a, b):
	mn = min(a, b)
	mx = max(a, b)
	if mx % mn == 0:
		return mn
	else:
		return gcd(mn, mx % mn)
zero = 0
ans = 0
c = 0
d = {}
for i in range(n):
	if m[i] == 0 and l[i] == 0:
		c += 1
	elif m[i] == 0:
		zero += 1
		ans = max(ans, zero)
	elif l[i] == 0:
		continue
	else:
		h = int(abs(m[i]))
		w = int(abs(l[i]))
		g = int(gcd(h, w))
		x = h / g
		y = w / g
		if int(abs(m[i] + l[i])) != h + w:
			x = -x
		d[x, y] = d.get((x, y), 0) + 1
		ans = max(ans, d[x, y])
print(ans + c)


def cmmdc(a, b):
	while b:
		c = a % b
		a = b
		b = c
	return a
n = int(input())
a = [int(x) for x in input().strip().split(' ')]
b = [int(x) for x in input().strip().split(' ')]
dict = {}
whatever = 0
for (i, j) in zip(a, b):
	if i != 0:
		fracA = -j
		fracB = i
		div = cmmdc(fracA, fracB)
		fracA //= div
		fracB //= div
		key = (fracA, fracB)
		if key in dict.keys():
			dict[key] += 1
		else:
			dict[key] = 1
	elif i == 0 and j == 0:
		whatever += 1
if len(dict) == 0:
	print(whatever)
else:
	print(max(dict.values()) + whatever)


from math import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
s = 0
m = 0
for i in range(n):
	if a[i] != 0:
		g = gcd(a[i], b[i])
		(ai, bi) = (a[i], b[i])
		if ai < 0:
			(ai, bi) = (-ai, -bi)
		ai //= g
		bi //= g
		f = (bi, ai)
		if f not in d:
			d[f] = 0
		d[f] += 1
		m = max(m, d[f])
	elif b[i] == 0:
		s += 1
try:
	print(s + max(d.values()))
except ValueError:
	print(s)


from math import gcd
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0
t = Counter()
for i in range(n):
	if a[i] == 0:
		if b[i] == 0:
			ans += 1
		else:
			continue
	else:
		g = gcd(a[i], b[i])
		if a[i] < 0:
			t[-a[i] // g, -b[i] // g] += 1
		else:
			t[a[i] // g, b[i] // g] += 1
ma = 0
for el in t:
	ma = max(t[el], ma)
print(ma + ans)


from sys import stdin as si

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def evaluate(n, A, B):
	map = {}
	count = 0
	for i in range(n):
		if B[i] == 0 and A[i] == 0:
			count += 1
			continue
		if A[i] == 0:
			continue
		g = gcd(A[i], B[i])
		d = (-1 * B[i] // g, A[i] // g)
		map[d] = map.get(d, 0) + 1
	mx = 0
	for (k, v) in map.items():
		mx = max(mx, v)
	return mx + count
n = int(si.readline().strip())
a = list(map(int, si.readline().strip().split()))
b = list(map(int, si.readline().strip().split()))
print(evaluate(n, a, b))


from collections import defaultdict
from math import gcd

def solve():
	N = int(input())
	A = [int(k) for k in input().split()]
	B = [int(k) for k in input().split()]
	cnt = defaultdict(int)
	add = 0
	for i in range(N):
		if B[i] == 0:
			if A[i] == 0:
				add += 1
				continue
			cnt[0] += 1
			continue
		if A[i] == 0:
			continue
		d = gcd(A[i], B[i])
		if B[i] // A[i] < 0:
			s = '-'
		else:
			s = '+'
		cnt[s, abs(B[i] // d), abs(A[i] // d)] += 1
	print(add + (0 if not cnt else max(cnt.values())))
solve()


import math

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
from decimal import Decimal
n = int(input())
d = {}
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
mx = 0
for i in range(n):
	if a[i] != 0 and b[i] != 0:
		k = Decimal(a[i]) / Decimal(b[i])
		d[k] = d.get(k, 0) + 1
	elif b[i] == 0 and a[i] != 0:
		d[0] = d.get(0, 0) + 1
	elif a[i] == 0 and b[i] == 0:
		mx += 1
s = list(d.values())
if len(s) == 0:
	print(max(mx, 0))
else:
	print(max(mx, max(s) + mx))


from decimal import *
t = int(input())
a = list(map(Decimal, input().split()))
b = list(map(Decimal, input().split()))
d = {}
f = 0
for i in range(t):
	if a[i] == 0 and b[i] == 0:
		f += 1
		continue
	elif a[i] == 0:
		continue
	p = b[i] / a[i]
	d[p] = d.get(p, 0) + 1
print()
print(max(list(d.values()) + [0]) + f)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
from collections import deque
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	zero = 0
	d = collections.defaultdict(lambda : 0)
	cnt = 0
	for i in range(n):
		if b[i] == 0 and a[i] != 0:
			zero += 1
		if b[i] == 0 and a[i] == 0:
			cnt += 1
		if b[i] != 0 and a[i] != 0:
			g = math.gcd(a[i], b[i])
			v = str(abs(a[i] // g)) + '/' + str(abs(b[i] // g))
			if a[i] * b[i] < 0:
				v = '-' + v
			d[v] += 1
	ans = zero
	for k in d.keys():
		ans = max(ans, d[k])
	print(ans + cnt)
main()


n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
from fractions import Fraction
from collections import defaultdict
d = defaultdict(lambda : 0)
ans = 0
import math
for (a, b) in zip(A, B):
	if a != 0:
		if b != 0:
			a_ = abs(a)
			b_ = abs(b)
			g = math.gcd(a, b)
			(a_, b_) = (a_ // g, b_ // g)
			if a > 0 and b > 0:
				d[a_, b_] += 1
			elif a > 0 and b < 0:
				d[a_, -b_] += 1
			elif a < 0 and b > 0:
				d[a_, -b_] += 1
			else:
				d[a_, b_] += 1
		else:
			d[0] += 1
	elif b == 0:
		ans += 1
if len(d) == 0:
	print(ans)
	exit()
c = list(d.items())
c.sort(key=lambda x: -x[1])
ans += c[0][1]
print(ans)


from fractions import Fraction
ans = 0
ans1 = 0
n = int(input(''))
s1 = list(map(int, input('').split()))
s2 = list(map(int, input('').split()))
t = []

def f(x, y):
	(x, y) = (max(x, y), min(x, y))
	if y == 0:
		return x
	return f(y, x % y)

def g(x, y):
	if x < 0 and y < 0:
		return (abs(x), abs(y))
	elif x < 0 or y < 0:
		return (-abs(x), abs(y))
	else:
		return (abs(x), abs(y))

def h(x, y):
	s = f(abs(x), abs(y))
	return g(x // s, y // s)
for i in range(n):
	if s1[i] == 0:
		if s2[i] == 0:
			ans += 1
			ans1 += 1
	elif s2[i] == 0:
		ans1 += 1
	else:
		t.append(h(s1[i], s2[i]))
q = {i: 0 for i in t}
for i in t:
	q[i] += 1
if len(q.values()) == 0:
	ans += 0
else:
	ans += max(q.values())
print(max(ans, ans1))


from decimal import Decimal
n = int(input())
a = input().split(' ')
b = input().split(' ')
d = {}
cnt = 0
maxn = 0
for i in range(n):
	if a[i] == '0' and b[i] == '0':
		cnt += 1
		continue
	if a[i] == '0' and b[i] != '0':
		continue
	temp = Decimal(b[i]) / Decimal(a[i])
	if temp in d:
		d[temp] += 1
		if d[temp] > maxn:
			maxn = d[temp]
	else:
		d[temp] = 1
		if maxn == 0:
			maxn = 1
print(int(maxn + cnt))


from collections import defaultdict
import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = list(map(Decimal, input().split()))
b = list(map(Decimal, input().split()))
dic = {}
ele = 0
for i in range(0, len(a)):
	if a[i] == 0 and b[i] == 0:
		ele += 1
	elif a[i] == 0:
		pass
	else:
		d = b[i] / a[i]
		if d in dic:
			dic[d] += 1
		else:
			dic[d] = 1
ans = 0
for key in dic:
	if dic[key] > ans:
		ans = dic[key]
print(ans + ele)


from math import *
n = int(input())
b = list(map(int, input().split()))
c = list(map(int, input().split()))
k = {}
mx = 0
q = 0
for i in range(n):
	if b[i] == 0 and c[i] == 0:
		q += 1
		continue
	if b[i] == 0:
		continue
	(x, y) = (b[i] // gcd(abs(c[i]), abs(b[i])), -c[i] // gcd(abs(c[i]), abs(b[i])))
	if x != abs(x) and x != 0:
		x *= -1
		y *= -1
	if str(x) + ' ' + str(y) in k:
		k[str(x) + ' ' + str(y)] += 1
	else:
		k[str(x) + ' ' + str(y)] = 1
	mx = max(mx, k[str(x) + ' ' + str(y)])
print(mx + q)


from math import gcd
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
d = dict()
m = 0
for i in range(n):
	if A[i] != 0:
		g = gcd(abs(A[i]), abs(B[i]))
		t = B[i] // g
		s = A[i] // g
		if A[i] * B[i] < 0:
			t = -abs(t)
			s = abs(s)
		else:
			t = abs(t)
			s = abs(s)
		u = (t, s)
		if u in d.keys():
			d[u] += 1
		else:
			d[u] = 1
	elif B[i] == 0:
		m += 1
x = 0
for i in d.keys():
	x = max(x, d[i])
print(m + x)


def gcd(x, y):
	if not y:
		return x
	else:
		return gcd(y, x % y)

def simplify(x, y):
	if y < 0:
		y *= -1
		x *= -1
	if y and (not x):
		return (0.5, 0.5)
	if not y and (not x):
		return (1.5, 1.5)
	if not y and x:
		return (2.5, 2.5)
	d = gcd(abs(x), abs(y))
	return (x // d, y // d)
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
counter = dict()
for i in range(n):
	dd = simplify(a[i], b[i])
	counter[dd] = counter.get(dd, 0) + 1
counter[0.5, 0.5] = 0
zero = counter.get((1.5, 1.5), 0)
counter[1.5, 1.5] = 0
print(max(counter.values()) + zero)


import math

def fun(a, b, n):
	res = 0
	rec = {}
	for i in range(n):
		if a[i] == 0:
			if b[i] == 0:
				res += 1
			continue
		div = math.gcd(b[i], a[i])
		if b[i] < 0 and a[i] < 0 or (b[i] >= 0 and a[i] < 0):
			b[i] = -b[i]
			a[i] = -a[i]
		d = (b[i] / div, a[i] / div)
		if d in rec:
			rec[d] += 1
		else:
			rec[d] = 1
	if rec == {}:
		return res
	else:
		return max(rec.values()) + res
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
print(fun(a, b, n))


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = {}
x = 0
for i in range(n):
	if a[i] != 0:
		k = gcd(abs(a[i]), abs(b[i]))
		m = 0
		if b[i] / a[i] < 0:
			m = 1
		if b[i] == 0:
			a[i] = 0
		r = (abs(b[i]) // k, abs(a[i]) // k, m)
		d[r] = d.get(r, 0) + 1
	elif b[i] == 0:
		x += 1
if len(d) > 0:
	print(max(d.values()) + x)
else:
	print(x)


from math import gcd
from collections import Counter

def frac(x, y):
	d = gcd(x, y)
	(x, y) = (x // d, y // d)
	if x < 0 and y < 0:
		(x, y) = (-x, -y)
	elif y < 0:
		(x, y) = (-x, -y)
	return str(x) + '/' + str(y)

def main(n, a, b):
	(c, result) = ([0] * n, 0)
	for i in range(n):
		if a[i] != 0:
			c[i] = str(frac(-b[i], a[i]))
		elif a[i] == 0 and b[i] == 0:
			result += 1
			c[i] = 'res'
		else:
			c[i] = 'res'
	d = dict(Counter(c))
	ma = 0
	for key in d.keys():
		if key != 'res':
			ma = max(d[key], ma)
	return ma + result
m = int(input())
lst1 = [int(j) for j in input().split()]
lst2 = [int(j) for j in input().split()]
print(main(m, lst1, lst2))


from decimal import *
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [-99999999999999999999999999] * n
getcontext().prec = 28
for i in range(n):
	if a[i] != 0:
		c[i] = Decimal(b[i]) / Decimal(a[i])
c.sort()
co = 0
for i in range(n):
	if a[i] == 0 and b[i] != 0:
		co += 1
if co == n:
	print(0)
	exit()
maxc = 0
for i in range(n):
	if c[i] != -99999999999999999999999999:
		maxc = 1
i = 0
while i < len(c):
	if c[i] == -99999999999999999999999999:
		c.pop(i)
	else:
		i += 1
co = 1
for i in range(1, len(c)):
	if c[i] == c[i - 1]:
		co += 1
		if co > maxc:
			maxc = co
	else:
		co = 1
if n == 1:
	if a[0] == 0 and b[0] != 0:
		print(0)
	else:
		print(1)
	exit()
for i in range(n):
	if a[i] == 0 and b[i] == 0:
		maxc += 1
print(maxc)


from collections import defaultdict
from fractions import *
n = int(input())
a = list(map(int, list(input().split(' '))))
b = list(map(int, list(input().split(' '))))
result_count = 0
results = defaultdict(lambda : 0)
for k in range(n):
	if a[k] == 0 and b[k] == 0:
		result_count += 1
		continue
	if a[k] == 0:
		continue
	sign = '-'
	if b[k] < 0 and a[k] > 0 or (a[k] < 0 and b[k] > 0):
		sign = '+'
	gcd_ = gcd(abs(a[k]), abs(b[k]))
	results[sign, abs(b[k] // gcd_), abs(a[k] // gcd_)] += 1
if len(results.values()) == 0:
	print(result_count)
else:
	print(result_count + max(results.values()))