Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square, it will become dirty, and if she sweeps over a dirty square, it will become clean. She wants to sweep some columns of the room to maximize the number of rows that are completely clean. It is not allowed to sweep over the part of the column, Ohana can only sweep the whole column.

Return the maximum number of rows that she can make completely clean.


-----Input-----

The first line of input will be a single integer n (1 ≤ n ≤ 100).

The next n lines will describe the state of the room. The i-th line will contain a binary string with n characters denoting the state of the i-th row of the room. The j-th character on this line is '1' if the j-th square in the i-th row is clean, and '0' if it is dirty.


-----Output-----

The output should be a single line containing an integer equal to a maximum possible number of rows that are completely clean.


-----Examples-----
Input
4
0101
1000
1111
0101

Output
2

Input
3
111
111
111

Output
3



-----Note-----

In the first sample, Ohana can sweep the 1st and 3rd columns. This will make the 1st and 4th row be completely clean.

In the second sample, everything is already clean, so Ohana doesn't need to do anything.

Difficulty: EASY

Solutions:
n = int(input())
arr = []
maxt = 0
for i in range(0, n):
	arr.append(input())
for k in range(0, len(arr)):
	p = arr.count(arr[k])
	if p > maxt:
		maxt = p
print(maxt)


from collections import Counter
n = int(input())
print(max(Counter((input() for _ in range(n))).values()))


n = int(input())
big = [[] for i in range(n)]
for i in range(n):
	big[i] = [int(x) for x in list(input())]
mx = 0
cr = 0
for item in big:
	cr = big.count(item)
	mx = max([cr, mx])
print(mx)


n = int(input())
cnt = {}
for i in range(n):
	line = input()
	if line not in cnt:
		cnt[line] = 1
	else:
		cnt[line] += 1
print(max([cnt[r] for r in cnt]))


n = int(input())
a = []
while n:
	n -= 1
	a.append(input())
maxc = 0
for i in range(len(a)):
	c = 0
	for j in range(i, len(a)):
		if a[i] == a[j]:
			c += 1
	maxc = max(c, maxc)
print(maxc)


import sys
input = sys.stdin.readline
rooms = []
same = []
for i in range(int(input())):
	rooms.append(input())
for k in rooms:
	same.append(rooms.count(k))
print(max(same))


import sys
n = int(sys.stdin.readline().strip())
line = {}
max_val = 0
for l in range(n):
	tmp = sys.stdin.readline().strip()
	if tmp in line:
		line[tmp] = line[tmp] + 1
		max_val = max_val if max_val > line[tmp] else line[tmp]
	else:
		line[tmp] = 1
		max_val = max_val if max_val > line[tmp] else line[tmp]
print(max_val)


n = int(input())
l = []
x = []
for i in range(n):
	l.append(input())
for i in range(n):
	x.append(l.count(l[i]))
print(max(x))


n = int(input())
s = [input() for i in range(n)]
se = list(set(s))
ma = max((s.count(i) for i in se))
print(ma)


n = int(input())
s = []
for i in range(n):
	s.append(input())
s.sort()
m = 0
c = 1
for i in range(1, n):
	if s[i] == s[i - 1]:
		c += 1
	else:
		if c > m:
			m = c
		c = 1
if c > m:
	m = c
print(m)


n = int(input())
a = []
for i in range(n):
	a.append(input())
max_v = 0
for i in range(n):
	if a[i] == '1' * n:
		max_v += 1
for i in range(n):
	v = 0
	for j in range(n):
		if a[i] == a[j]:
			v += 1
	if v > max_v:
		max_v = v
print(max_v)


__author__ = 'taras-sereda'
from collections import Counter

def b():
	n = int(input())
	mat = [input() for i in range(n)]
	return Counter(mat).most_common(1)[0][1]

def __starting_point():
	print(b())
__starting_point()


import sys
r = [sys.stdin.readline() for _ in range(int(sys.stdin.readline()))]
print(max((r.count(i) for i in r)))


n = int(input())
l = []
for _ in range(n):
	l.append(int(input()))
d = {}
for i in l:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
print(max(d.values()))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict, deque

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

def I():
	return int(input())

def LIST(n, m=None):
	return [0] * n if m is None else [[0] * m for i in range(n)]

def ELIST(n):
	return [[] for i in range(n)]

def MI(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = VI()
	return arr

def MS(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = input()
	return arr

def MIT(n=None, m=None):
	if n is None:
		(n, m) = VI()
	a = MI(n, m)
	arr = LIST(m, n)
	for (i, l) in enumerate(a):
		for (j, x) in enumerate(l):
			arr[j][i] = x
	return arr

def main(info=0):
	n = I()
	a = MS(n)
	d = defaultdict(int)
	for x in a:
		d[x] += 1
	print(max(d.values()))
main()


from collections import defaultdict
d = defaultdict(int)
for _ in range(int(input())):
	d[input()] += 1
print(max(d.values()))


I = input
s = [I() for _ in '0' * int(I())]
print(max((s.count(i) for i in s)))


import sys
import math
import collections
from pprint import pprint
ss = {}
n = int(input())
for i in range(n):
	s = input()
	if s in ss:
		ss[s] += 1
	else:
		ss[s] = 1
mx = 0
for i in ss:
	mx = max(mx, ss[i])
print(mx)


from collections import defaultdict as DD
n = int(input())
d = DD(int)
for i in range(n):
	d[input()] += 1
print(max((v for (k, v) in d.items())))


x = []
for i in range(int(input())):
	x.append(input())
m = 1
for i in x:
	m = max(m, x.count(i))
print(m)


n = int(input())
s = [input() for i in range(n)]
print(max((s.count(x) for x in s)))


n = int(input())
line = []
big = 1
for i in range(n):
	line.append(input())
for i in range(n):
	if line.count(line[i]) > big:
		big = line.count(line[i])
print(big)


n = int(input())
d = {}
for i in range(n):
	r = input()
	if r in d:
		d[r] += 1
	else:
		d[r] = 1
m = 0
for c in d:
	m = max(m, d[c])
print(m)


n = int(input())
d = {}
for i in range(n):
	row = input()
	entry = ''
	for i in range(n):
		ch = row[i:i + 1]
		if ch == '0':
			entry = entry + str(i)
	d[entry] = d.get(entry, 0) + 1
answer = 0
for (k, v) in d.items():
	if v > answer:
		answer = v
print(answer)


n = int(input())
matrix = []
for i in range(n):
	matrix.append(list(input()))
max_count = 0
for k in matrix:
	count = 0
	for i in matrix:
		count += k == i and 1 or 0
	max_count = max(max_count, count)
print(max_count)


from collections import defaultdict
n = int(input())
d = defaultdict(int)
for i in range(n):
	s = input()
	d[s] += 1
mx = 0
for i in d:
	mx = max(mx, d[i])
print(mx)


n = int(input())
arr = [0] * n
for i in range(n):
	arr[i] = list(map(int, list(input())))
m = 0
for i in range(n):
	v = [0] * n
	for j in range(n):
		if arr[i][j] == 0:
			v[j] = 1
	c = 0
	for j in range(n):
		for k in range(n):
			if v[k] == 1:
				if 1 - arr[j][k] != 1:
					break
			elif arr[j][k] != 1:
				break
		else:
			c += 1
	m = max(c, m)
print(m)


def main():
	n = int(input())
	lines = []
	d = {}
	for _ in range(n):
		l = input()
		if l not in d:
			d[l] = 0
		d[l] += 1
	ans = max(d.values())
	print(ans)
main()


from copy import deepcopy
n = int(input())
mu = []
for i in range(0, n):
	mu.append(list(input()))
ma = deepcopy(mu)
rwmc = 0
for i in range(0, n):
	for j in range(0, n):
		if '1' == mu[i][j]:
			for row in range(0, n):
				ma[row][j] = '0' if '1' == mu[row][j] else '1'
		else:
			for row in range(0, n):
				ma[row][j] = mu[row][j]
	rwc = 0
	for row in range(0, n):
		if not '1' in ma[row]:
			rwc += 1
	if rwc > rwmc:
		rwmc = rwc
print(rwmc)


n = int(input())
co = 0
l = []
for i in range(n):
	s = str(input())
	l.append(s)
	if len(set(s)) == 1 and s[0] == '1':
		co += 1
if co == n:
	print(n)
else:
	maxo = 0
	for i in range(len(l)):
		k = l.count(l[i])
		maxo = max(maxo, k)
	print(max(co, maxo))


__author__ = 'myduomilia'
(n, arr, ans) = (int(input()), [], 1)
for i in range(n):
	arr.append(input())
for i in range(n):
	c = 1
	for j in range(n):
		c += 1 if arr[i] == arr[j] else 0
	ans = max(ans, c)
print(ans - 1)


n = int(input())
arr = []
for i in range(n):
	arr.append(list(input()))
arr.sort()
ans = 0
left = 0
right = 0
while right < n and left < n:
	if arr[left] == arr[right]:
		ans = max(ans, right - left + 1)
		right += 1
	else:
		left += 1
print(ans)


import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import random
import re
import sys
import time
import string
from typing import List
sys.setrecursionlimit(99999)
n = int(input())
c = collections.defaultdict(int)
for _ in range(n):
	s = input()
	c[s] += 1
print(max(c.values()))


n = int(input())
i = 0
l = []
b = [0] * n
while i < n:
	a = input()
	j = 0
	c = int(a, 2)
	k = 0
	b[i] = c
	i = i + 1
i = 0
c = [0] * n
while i < n:
	j = 0
	while j < n:
		if b[i] == b[j]:
			c[i] += 1
		j = j + 1
	i = i + 1
print(max(c))


a = int(input())
s = dict()
for i in range(a):
	cur = input()
	if s.get(cur) != None:
		s[cur] += 1
	else:
		s[cur] = 1
print(max(s.values()))


n = int(input())
a = [list(input()) for i in range(n)]
Max = 0
for i in a:
	cnt = 0
	for j in a:
		if i == j:
			cnt += 1
	Max = max(cnt, Max)
print(Max)


from collections import Counter
n = int(input().strip())
c = Counter()
for _ in range(n):
	w = str(input().strip())
	c[w] += 1
(_, val) = c.most_common(1)[0]
print(val)


n = int(input())
a = []
for i in range(n):
	a.append(input())
if n < 2:
	print(1)
	exit()
a.sort()
b = []
k = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		k += 1
	else:
		b.append(k + 1)
		k = 0
	if i == n - 2:
		b.append(k + 1)
b.sort()
print(b[len(b) - 1])


import copy

def swap(x: str) -> str:
	if x == '1':
		return '0'
	return '1'

def find_dirty(_list: list) -> int:
	judge = True
	for i in range(len(_list)):
		if _list[i] == '0':
			judge = False
			yield i
	if judge:
		yield (-1)

def clean(l1: [list], l2: list) -> [list]:
	if l2 == [-1]:
		return l1
	temp_list = copy.deepcopy(l1)
	for room_number in l2:
		for i in range(len(temp_list)):
			temp_list[i][room_number] = swap(temp_list[i][room_number])
	return temp_list

def clean_judge(_list: [list]) -> int:
	ans = 0
	for i in range(len(_list)):
		boolean = True
		for j in range(len(_list)):
			if _list[i][j] == '0':
				boolean = False
				break
		if boolean:
			ans += 1
	return ans
number = int(input())
room_list = []
for i in range(number):
	room_list.append(list(input()))
maxi = 0
for i in range(number):
	temp_dirty_room = []
	for j in find_dirty(room_list[i]):
		temp_dirty_room.append(j)
	row_num = clean_judge(clean(room_list, temp_dirty_room))
	maxi = max(maxi, row_num)
print(maxi)


n = int(input())
a = [input() for i in range(n)]
print(max((sum((i == j for j in a)) for i in a)))


n = int(input())
room = []
c = 0
for i in range(n):
	room.append(input())
s = set(room)
ans = max((room.count(e) for e in s))
print(ans)


n = int(input())
d = {}
for _ in range(n):
	temp = input()
	if temp in d:
		d[temp] += 1
	else:
		d[temp] = 1
ans = 0
for i in d:
	ans = max(ans, d[i])
print(ans)


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb

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

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))
n = int(input())
l = []
while n:
	n -= 1
	s = input()
	l.append(s)
dic = get_frequency(l)
print(dic[max(dic, key=dic.get)])


from functools import reduce
n = int(input())
s = [input() for i in range(n)]
print(reduce(max, [s.count(i) for i in s], 1))


n = int(input())
l1 = []
for i in range(0, n):
	s1 = input()
	l1.append(s1)
print(l1.count(max(l1, key=l1.count)))


from collections import Counter

def solve():
	n = int(input())
	l = [input() for _ in range(n)]
	c = Counter(l)
	print(c.most_common(1)[0][1])
solve()


n = int(input())
z = [[int(k) for k in input().split()] for i in range(n)]
ans = 0
for i in z:
	ans = max(ans, z.count(i))
print(ans)


t = int(input())
s = []
for i in range(t):
	s.append(input())
dic = {}
for i in s:
	if any((i in d for d in dic)):
		dic[i] = dic[i] + 1
	else:
		dic[i] = 1
res = 1
for key in dic:
	if dic[key] > res:
		res = dic[key]
print(res)


from collections import Counter
cnt = Counter()
n = int(input())
for i in range(n):
	x = input()
	cnt[x] += 1
m = 0
for i in cnt:
	m = max(m, cnt[i])
print(m)


A = [input() for i in range(int(input()))]
print(max([A.count(elem) for elem in A]))


room = [input() for _ in range(int(input()))]
print(max((room.count(el) for el in room)))


def main():
	n = int(input())
	grid = [input() for _ in range(n)]
	row_map = {}
	max_frequency = 0
	for row in grid:
		if row in row_map:
			row_map[row] += 1
		else:
			row_map[row] = 1
		max_frequency = max(max_frequency, row_map[row])
	print(max_frequency)

def __starting_point():
	main()
__starting_point()


n = int(input())
s = [input() for i in range(n)]
print(max((sum((i == j for j in s)) for i in s)))


import sys
import math
import collections
from pprint import pprint as pp
mod = 1000000007
MAX = 10 ** 10

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

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

def vector(size, val=0):
	vec = [val for i in range(size)]
	return vec

def matrix(rowNum, colNum, val=0):
	mat = []
	for i in range(rowNum):
		collumn = [val for j in range(colNum)]
		mat.append(collumn)
	return mat

def main():
	ss = {}
	n = int(input())
	for i in range(n):
		s = input()
		if s in ss:
			ss[s] += 1
		else:
			ss[s] = 1
	mx = 0
	for i in ss:
		mx = max(mx, ss[i])
	print(mx)
main()


n = int(input())
grid = []
cn = [1 for i in range(n)]
for i in range(n):
	row = input()
	if row in grid:
		cn[i] = grid.count(row) + 1
	grid.append(row)
print(max(cn))


n = int(input())
a = []
b = [1] * n
for i in range(n):
	k = input()
	if k in a:
		b[a.index(k)] += 1
	else:
		a.append(k)
print(max(b))


n = int(input())
l = []
for i in range(n):
	s = input()
	l.append(s)
result = 0
for i in l:
	if l.count(i) > result:
		result = l.count(i)
print(result)


mod = 10 ** 9 + 7
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
l = []
mx = 0
for i in range(n):
	l.append(si())
for i in range(n - 1):
	c = 0
	for j in range(i + 1, n):
		if l[i] == l[j]:
			c += 1
	mx = max(mx, c)
print(mx + 1)


n = int(input())
dic = dict()
for i in range(n):
	s = input()
	if s not in dic:
		dic[s] = 1
	else:
		dic[s] += 1
print(max(dic.values()))


n = int(input())
l = [input() for i in range(n)]
m = 0
for i in range(0, len(l)):
	mi = 1
	for j in range(i + 1, len(l)):
		if l[i] == l[j]:
			mi += 1
	m = max(m, mi)
print(m)


n = int(input())
d = {}
m = 0
for i in range(n):
	s = input()
	if s not in d:
		d[s] = 0
	d[s] += 1
	if d[s] > m:
		m = d[s]
print(str(m))


def frequent(s):
	from collections import Counter
	cc = Counter(s).most_common(1)
	return cc[0][1]
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
n = ii()
r = []
for i in range(n):
	r.append(si().replace(' ', ''))
print(frequent(r))


import unittest
import sys
import re

class Clean:

	def __init__(self, args):
		self.args = args
		self.list = args

	def r2dec(self, row):
		return int(self.list[row], 2)

	def calculate(self):
		result = 0
		d = {}
		for i in range(len(self.list)):
			key = self.r2dec(i)
			if key in d:
				d[key] += 1
			else:
				d[key] = 1
		for n in d:
			if result < d[n]:
				result = d[n]
		return result

def decode_inputs(inputs):
	strlist = inputs[1:]
	return strlist

def calculate(inputs):
	return Clean(decode_inputs(inputs)).calculate()

def main():
	num = int(input())
	inputs = [input() for n in range(num)]
	inputs.insert(0, num)
	print(calculate(inputs))

class unitTests(unittest.TestCase):

	def test_decode_inputs(self):
		self.assertEqual(decode_inputs(['2', '00', '10']), ['00', '10'])

	def test_Clean_class__basic_functions(self):
		d = Clean(['00', '11'])
		self.assertEqual(d.list[1], '11')
		self.assertEqual(d.r2dec(1), 3)

	def test_calculate(self):
		self.assertEqual(calculate(['4', '0101', '1000', '1111', '0101']), 2)
		self.assertEqual(calculate(['3', '111', '111', '111']), 3)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
main()


n = int(input())
a = []
for i in range(n):
	a.append(input())
a.sort()
o = k = 1
for i in range(1, n):
	if a[i] == a[i - 1]:
		k = k + 1
		o = max(o, k)
	else:
		k = 1
print(o)


n = int(input())
xxs = {}
sol = 1
for i in range(n):
	xs = input()
	if xs in xxs:
		val = xxs[xs]
		xxs[xs] = val + 1
		sol = max(sol, val + 1)
	else:
		xxs[xs] = 1
print(sol)


def most_common(a):
	return max(set(a), key=a.count)
n = int(input())
import sys
a = sys.stdin.readlines()
print(a.count(most_common(a)))


room = [input() for i in range(int(input()))]
print(max([room.count(i) for i in room]))


n = int(input())
l = []
for i in range(n):
	x = input()
	l.append(x)
s = set(l)
ans = -100
for i in s:
	ans = max(ans, l.count(i))
print(ans)


from collections import defaultdict
n = int(input())
total = 0
count = defaultdict(int)
for _ in range(n):
	s = input()
	key = tuple((i for (i, c) in enumerate(s) if c == '0'))
	count[key] += 1
print(max(count.values()))


def func(x):
	pass

def __starting_point():
	x = int(input())
	grid = {}
	for _ in range(x):
		row = input()
		if row not in grid:
			grid[row] = 1
		else:
			grid[row] += 1
	best_value = 0
	for (key, value) in list(grid.items()):
		if value > best_value:
			best_value = value
	print(best_value)
__starting_point()


n = int(input())
d = {}
for i in range(n):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
print(d[max(d, key=d.get)])


n = int(input())
a = [[int(y) for y in input().strip()] for x in range(n)]
res = 0
for rIt in range(n):
	(toChange, curRes) = ([], 0)
	for cIt in range(n):
		toChange.append((a[rIt][cIt] + 1) % 2)
	for i in range(n):
		for j in range(n):
			if not (a[i][j] + toChange[j]) % 2:
				break
		else:
			curRes += 1
	if curRes > res:
		res = curRes
print(res)


def solve(n, seq):
	ans = 0
	temp = 1
	index = 0
	innerIndex = 0
	while index < n - 1:
		temp = 1
		innerIndex = index + 1
		while innerIndex < n:
			if seq[index] == seq[innerIndex]:
				temp += 1
			innerIndex += 1
		if temp > ans:
			ans = temp
		index += 1
	if temp > ans:
		ans = temp
	return ans
n = int(input())
seq = []
for x in range(n):
	seq.append(input())
print(solve(n, seq))


from collections import Counter
print(Counter((input() for i in range(int(input())))).most_common(1)[0][1])


n = int(input())
x = []
for i in range(n):
	x.append(str(input()))
y = list(set(x))
ans = []
for i in range(len(y)):
	ans.append(x.count(y[i]))
print(max(ans))


import sys
n = int(sys.stdin.readline())
rows = []
counts = []
for i in range(n):
	rows.append(sys.stdin.readline())
for i in range(n):
	counts.append(rows.count(rows[i]))
print(max(counts))


n = int(input())
l = []
numbers = []
for i in range(n):
	s1 = input()
	l.append(s1)
for i in range(n):
	count = l.count(l[i])
	numbers.append(count)
print(max(numbers))


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
n = ii()
r = []
for i in range(n):
	r.append(si().replace(' ', ''))
print(max((r.count(i) for i in r)))


import bisect
from itertools import accumulate
import os
import sys
import math
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())
dic = {}
for i in range(n):
	s = input()
	if s in dic:
		dic[s] += 1
	else:
		dic[s] = 1
print(max(dic.values()))


N = int(input())
d = {}
for i in range(N):
	l = input()
	if l not in d:
		d[l] = 0
	d[l] += 1
print(max(d.values()))


n = int(input())
(a, best) = ([], 0)
for i in range(n):
	b = list(map(int, input().split()))
	a.append(b)
for i in range(n):
	b = 0
	for j in range(i, n):
		if a[i] == a[j]:
			b += 1
	if b > best:
		best = b
print(best)


n = int(input())
room = []
for _ in range(n):
	row = tuple(input())
	room.append(row)
memo = {}
for i in range(n):
	try:
		memo[room[i]] += 1
	except KeyError:
		memo[room[i]] = 1
max_rows = max([(value, key) for (key, value) in memo.items()])
print(max_rows[0])


n = int(input())
l = [[int(i) for i in list(input())] for j in range(n)]
ans = 0
for i in range(n):
	l1 = []
	for j in range(n):
		l1.append(l[j])
	for j in range(n):
		if l1[i][j] == 0:
			for k in range(n):
				l1[k][j] = abs(l1[k][j] - 1)
	s = 0
	for j in range(n):
		if l1[j] == [1] * n:
			s += 1
	ans = max(ans, s)
print(ans)


def numClean(floor):
	num = 0
	for i in floor:
		if i.count('1') == len(i):
			num += 1
	return num

def most_common(list):
	return max(set(list), key=list.count)
n = int(input())
floor = []
for i in range(n):
	floor.append(input())
majority = list(most_common(floor))
for i in range(len(floor)):
	floor[i] = list(floor[i])
print(floor.count(majority))


import time
n = int(input())
table = []
for i in range(n):
	table.append([int(i) for i in input().split()])
start = time.time()
ans = 0
for i in range(n):
	buf = 0
	for j in range(n):
		if table[i] == table[j]:
			buf += 1
	if buf > ans:
		ans = buf
print(ans)
finish = time.time()


n = int(input())
a = []
for i in range(n):
	a.append([])
for i in range(n):
	a[i] = list(input().split())
dic = {}
for i in range(n):
	temp = ''.join(a[i])
	if temp in dic:
		dic[temp] += 1
	else:
		dic[temp] = 1
ans = 0
for (k, v) in dic.items():
	ans = max(ans, v)
print(ans)


n = int(input())
s = [input() for i in range(n)]
mx = 0
for a in s:
	cnt = s.count(a)
	mx = max(mx, cnt)
print(mx)


import sys
r = []
for i in range(int(input())):
	r.append(sys.stdin.readline())
print(max((r.count(i) for i in r)))


n = int(input())
row = []
sRow = []
nRow = []
for i in range(n):
	row += [input()]
for i in range(n):
	if not sRow.count(row[i]):
		sRow += [row[i]]
		nRow += [row.count(row[i])]
print(max(nRow))


s = [input() for i in range(int(input()))]
print(max((s.count(i) for i in list(set(s)))))


n = int(input())
a = [list(map(int, input())) for i in range(n)]
b = [[0] * n for i in range(n)]
res = 0
for i in range(n):
	for j in range(n):
		x = a[i][j] ^ 1
		for k in range(n):
			b[k][j] = a[k][j] ^ x
	c = 0
	for k in range(n):
		if b[k].count(0) == 0:
			c += 1
	res = max(res, c)
print(res)


(n, d) = (int(input()), dict())
for i in range(n):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
print(max((d[i] for i in d)))


import sys
n = int(input())
s = [x for x in sys.stdin.read().split()]
m = 0
for a in s:
	m = max(m, s.count(a))
print(m)


n = int(input())
d = dict()
for i in range(n):
	s = input()
	if not d.get(s, 0):
		d[s] = 1
	else:
		d[s] += 1
maxi = 0
for k in d:
	maxi = max(maxi, d[k])
print(maxi)


from collections import Counter
print(Counter((input() for _ in range(int(input())))).most_common(n=1)[0][1])


import sys

def main():
	n = int(sys.stdin.readline())
	data = list(sys.stdin.readlines())
	arr = []
	for x in data:
		arr.append(int(x, 2))
	m = 1
	for i in range(n):
		count = 0
		for j in range(n):
			if arr[i] ^ arr[j] == 0:
				count += 1
		if count > m:
			m = count
	print(m)
main()


n = int(input())
l = []
for i in range(n):
	tmp = list(map(int, input().split()))
	l.append(tmp)
ans = 0
for i in range(n):
	cnt = 0
	for j in range(n):
		if l[i] == l[j]:
			cnt -= -1
	ans = max(ans, cnt)
print(ans)


n = int(input())
book = dict()
for i in range(n):
	line = str(input())
	num = 1
	if line in book.keys():
		num += book.get(line)
	book.update({line: num})
line = list()
for (k, v) in book.items():
	line.append(v)
print(max(line))


n = int(input())
ls = {}
m = 0
for i in range(n):
	s = input()
	if s not in ls:
		ls[s] = 0
	val = ls[s]
	val += 1
	if val > m:
		m = val
	ls[s] = val
print(m)


from collections import Counter
n = int(input())
L = []
for i in range(n):
	L.append(input())
(most_common, num_most_common) = Counter(L).most_common(1)[0]
print(num_most_common)


n = int(input())
s = [None] * n
for i in range(n):
	s[i] = input()
res = 0
for i in range(n):
	count = 0
	for j in range(n):
		if s[i] == s[j]:
			count += 1
		res = max(count, res)
print(res)


n = int(input())
mt = dict()
for i in range(n):
	line = input()
	if line in mt:
		mt[line] += 1
	else:
		mt[line] = 1
print(max(mt.values()))


n = int(input())
a = []
for i in range(n):
	a.append(input())
res = 0
for i in range(n):
	count = 0
	for j in range(n):
		if a[i] == a[j]:
			count += 1
	res = max(res, count)
print(res)


n = int(input())
d = dict()
for i in range(n):
	a = input()
	if a not in d:
		d[a] = 1
	else:
		d[a] += 1
m = 0
for elem in d:
	m = max(m, d[elem])
print(m)


n = int(input())
columns = []
rows = []
for r in range(n):
	row = input()
	rows.append(row)
	columnsneeded = [i for i in range(n) if list(row)[i] == '0']
	columns.append(columnsneeded)
res = []
for mvmt in columns:
	bigcnt = 0
	for ro in rows:
		cnt = 0
		for sweep in mvmt:
			if ro[sweep] == '0':
				cnt += 1
			elif ro[sweep] == '1':
				continue
		for nonsweep in [bruh for bruh in range(n) if bruh not in mvmt]:
			if ro[nonsweep] == '1':
				cnt += 1
			elif ro[nonsweep] == '0':
				continue
		if cnt == n:
			bigcnt += 1
	res.append(bigcnt)
print(max(res))


l_s = list((input() for _ in range(int(input()))))
m = 0
for i in l_s:
	m = max(m, l_s.count(i))
print(m)


n = int(input())
a = [] * n
c = [0] * n
x = 0
for i in range(n):
	l = int(input())
	if l not in a:
		a.append(l)
	if l in a:
		c[a.index(l)] += 1
print(max(c))


import sys
import math
import random
if len(sys.argv) >= 2:
	if sys.argv[1] == 'LOCAL':
		sys.stdin = open('input.in', 'r')
n = int(input())
clean = {}
i = 0
while i < n:
	s = input()
	try:
		clean[s] += 1
	except:
		clean[s] = 1
	i += 1
ans = 0
for i in clean:
	ans = max(ans, clean[i])
print(ans)


n = int(input())
arows = []
for i in range(n):
	arows.append([] * n)
for i in range(n):
	s = input()
	for k in range(n):
		arows[i].append(int(s[k]))
equalmax = 1
clean = 0
for i in range(n):
	if arows[i] == [1, 1, 1, 1]:
		clean += 1
	equal = 1
	for j in range(i + 1, n):
		if arows[i] == arows[j]:
			equal += 1
	if equal > equalmax:
		equalmax = equal
print(max(clean, equalmax))


n = int(input())
list = []
max = 0
for i in range(n):
	list.append(input())
for i in list:
	temp = list.count(i)
	if max < temp:
		max = temp
print(max)


from collections import Counter
n = int(input())
grid = [[int(c) for c in input()] for _ in range(n)]
cnt = Counter()
for line in grid:
	changes = tuple((i for i in range(n) if line[i] == 0))
	cnt[changes] += 1
print(max(cnt.values()))


n = int(input())
d = {}
for i in range(n):
	s = input()
	if s not in d:
		d[s] = 1
	else:
		d[s] += 1
print(max(d.values()))


a = int(input())
d = {}
for _ in ' ' * a:
	z = input()
	d[z] = d.get(z, 0) + 1
print(max(d.values()))


from sys import stdin, stdout
from os import path
rd = lambda : stdin.readline().strip()
wr = stdout.write
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
import time
arr = [rd() for _ in range(int(rd()))]
print(max((arr.count(s) for s in arr)))


def check(c):
	for char in c:
		if char == '0':
			return False
	return True
n = int(input())
s = []
eq = [0 for i in range(n)]
for i in range(n):
	s.append(input())
clean = 0
for c in s:
	if check(c):
		clean += 1
for i in range(n):
	for j in range(i, n):
		if s[i] == s[j]:
			eq[i] += 1
print(max(clean, max(eq)))


from collections import Counter as c
a = c((input() for i in range(int(input()))))
(b, d) = a.most_common(1)[0]
print(d)


import sys
input = sys.stdin.readline
n = int(input())
k = [input().strip() for i in range(n)]
k.sort()
lolcount = 1
count = 1
for i in range(1, n):
	if k[i] == k[i - 1]:
		count += 1
	else:
		if lolcount < count:
			lolcount = count
		count = 1
if count > lolcount:
	lolcount = count
print(lolcount)


n = int(input())
matrix = []
for i in range(n):
	matrix.append(int(''.join(input().split())))
matrix.sort()
ans = 1
cnt = 1
for i in range(1, n):
	if matrix[i] == matrix[i - 1]:
		cnt += 1
	else:
		cnt = 1
	if cnt > ans:
		ans = cnt
print(ans)


from collections import Counter
n = int(input())
l = []
for i in range(n):
	l.append(input())
d = Counter(l)
print(max(d.values()))


n = int(input())
m = []
for i in range(n):
	s = input()
	m.append(s)
d = {}
for i in range(len(m)):
	r = ''
	x = m[i]
	for j in range(len(x)):
		if x[j] == '0':
			r += str(j)
	if r in d:
		d[r] += 1
	else:
		d[r] = 1
y = d.values()
print(max(y))


t = dict()
for s in [input() for i in range(int(input()))]:
	t[s] = t.get(s, 0) + 1
print(max([t[s] for s in t]))


n = int(input())
a = list()
for i in range(n):
	a.append(input())
b = dict()
for i in range(n):
	if a[i] in b:
		b[a[i]] += 1
	else:
		b.update({a[i]: 1})
print(max(b.values()))


n = int(input())
b = [tuple(map(int, tuple(input()))) for x in range(n)]
d = {b.count(x) for x in b}
print(max(d))


n = int(input())
l = []
m = 0
for i in range(n):
	l.append(input())
for i in range(n):
	s = 0
	for j in range(n):
		if l[i] == l[j]:
			s += 1
	m = max(m, s)
print(m)


n = int(input())
d = {}
for xyz in range(n):
	s = input()
	if s in d.keys():
		d[s] += 1
	else:
		d[s] = 1
print(max(d.values()))


r = [input() for _ in range(int(input()))]
print(max((r.count(i) for i in r)))


from collections import defaultdict as dd
n = int(input())
d = dd(int)
for i in range(n):
	l = input().strip()
	d[l] += 1
m = sorted(d.values())[-1]
print(m)


l = [input() for _ in range(int(input()))]
m = 0
for x in l:
	m = max(m, l.count(x))
print(m)


n = int(input())
slv = dict()
arr = []
matrix = [[0] * n for i in range(n)]
for i in range(n):
	curr = input()
	if slv.get(curr) == None:
		slv[curr] = 1
	else:
		slv[curr] += 1
print(max(slv.values()))


n = int(input())
grid = []
for i in range(n):
	grid.append(input())
ans = 0

def count(clean):
	ret = 0
	for i in range(n):
		if isclean(i, clean):
			ret += 1
	return ret

def isclean(i, clean):
	for j in range(n):
		if j in clean:
			if grid[i][j] == '1':
				return False
		elif grid[i][j] == '0':
			return False
	return True

def makeclean(i):
	ret = []
	for j in range(n):
		if grid[i][j] == '0':
			ret.append(j)
	return ret
for i in range(n):
	ans = max(ans, count(makeclean(i)))
print(ans)


n = int(input())
rows = []
for i in range(n):
	row = input()
	rows += [row]

def sweepColumn(rows, i):

	def sweep(row):
		return row[0:i] + ('1' if row[i] == '0' else '0') + row[i + 1:]
	return [sweep(row) for row in rows]

def sweepColumns(rows, idxs):
	if len(idxs) == 0:
		return rows
	return sweepColumns(sweepColumn(rows, idxs[0]), idxs[1:])

def numCleanRows(rows):
	return len(list((row for row in rows if '1' not in row)))

def dirtyIdxs(row):
	return list((i for (i, e) in enumerate(row) if e == '1'))
print(max((numCleanRows(sweepColumns(rows, dirtyIdxs(row))) for row in rows)))


from collections import defaultdict
n = int(input())
a = []
k1 = []
c = 0
m = 0
for i in range(n):
	a1 = list(map(str, input()))
	a.append(a1)
for i in range(n):
	k = []
	c = 0
	for j in range(n):
		if a[i][j] == '0':
			k.append(j + 1)
		else:
			c += 1
	if c == n:
		m += 1
	if len(k) > 0:
		r = int(''.join(map(str, k)))
		k1.append(r)
freq = defaultdict(int)
ans = 0
for i in k1:
	freq[i] += 1
	ans = max(ans, freq[i])
if m > ans:
	print(m)
else:
	print(ans)


n = int(input())
b = [tuple(map(int, tuple(input()))) for x in range(n)]
d = set()
for x in b:
	a = b.count(x)
	d.add(a)
	if a > 2:
		while True:
			try:
				b.remove(x)
			except ValueError:
				break
print(max(d))


__author__ = 'artyom'

def main():
	hs = {}
	mx = 0
	for _ in range(read()):
		s = read(0)
		if s not in hs:
			hs[s] = 1
		else:
			hs[s] += 1
		if hs[s] > mx:
			mx = hs[s]
	return mx

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


from collections import Counter
n = int(input())
ans = 0
l = []
for i in range(n):
	s = input()
	if s == ''.join(['1'] * n):
		ans += 1
	l.append(s)
d = Counter(l)
k = max(d, key=d.get)
mx = d[k]
ans = max(ans, mx)
print(ans)


n = int(input())
grid = [[0] * n for i in range(n)]
for r in range(n):
	s = input()
	for c in range(n):
		grid[r][c] = ord(s[c]) - ord('0')
max_clean_count = 0
for r in range(n):
	state = [x ^ 1 for x in grid[r]]
	clean_count = 0
	for r2 in range(n):
		if all((grid[r2][c] ^ state[c] == 1 for c in range(n))):
			clean_count += 1
	max_clean_count = max(max_clean_count, clean_count)
print(max_clean_count)


n = int(input())
l = [input() for _ in range(n)]
d = {}
for x in l:
	d[x] = d.get(x, 0) + 1
print(max(d.values()))


n = int(input())
l = []
cou = []
for i in range(n):
	l.append(input())
for i in set(l):
	cou.append(l.count(i))
print(max(cou))


import sys
n = int(input())
map = dict()
max_value = -sys.maxsize - 1
for i in range(n):
	arr = input()
	if arr in map:
		map[arr] += 1
	else:
		map[arr] = 1
	max_value = max(max_value, map[arr])
print(max_value)


n = int(input())
A = [input() for i in range(n)]
ans = max((A.count(s) for s in A))
print(ans)


n = int(input())
min = -1
l = []
for i in range(n):
	s = str(input())
	l.append(s)
for i in range(0, len(l)):
	if l.count(l[i]) > min:
		min = l.count(l[i])
print(min)


import sys
digitInput = int(sys.stdin.readline().strip('\n'))
digitList = []
maxCount = 0
for i in range(digitInput):
	digitList.append(sys.stdin.readline().strip('\n'))
for n in set(digitList):
	if digitList.count(n) > maxCount:
		maxCount = digitList.count(n)
sys.stdout.write(str(maxCount))


n = int(input())
l = []
for i in range(n):
	s = input()
	l.append(s)
m = 0
for i in range(n - 1):
	if l[i] != -1:
		k = 1
		for j in range(i + 1, n):
			if l[i] == l[j]:
				k += 1
				l[j] = -1
	if k > m:
		m = k
if m == 0:
	print(1)
else:
	print(m)


n = int(input())
a = []
for i in range(n):
	a.append(list(input()))
ans = 0
for i in range(n):
	tmp = 1
	for j in range(i + 1, n):
		if a[i] == a[j]:
			tmp += 1
	ans = max(ans, tmp)
print(ans)


n = int(input())
b = [list(map(int, list(input()))) for _ in range(n)]
print(max((sum((sum((b[j][k] ^ b[i][k] ^ 1 for k in range(n))) == n for j in range(n))) for i in range(n))))


def deep(arr):
	temp = []
	for i in arr:
		temp.append(list(i))
	return temp
n = int(input())
arr = []
for _ in range(n):
	arr.append(list(map(int, input())))
temp = deep(arr)
ans = 0
for i in range(n):
	arr = deep(temp)
	for j in range(n):
		if arr[i][j] == 0:
			for k in range(n):
				arr[k][j] = 1 - arr[k][j]
	tot = 0
	for j in range(n):
		yay = 0
		for k in range(n):
			yay += arr[j][k]
		if yay == n:
			tot += 1
	ans = max(ans, tot)
print(ans)


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
mx = 0
for i in range(n):
	y = arr[i:].count(arr[i])
	mx = max(y, mx)
print(mx)


n = int(input())
arr = []
for _ in range(n):
	arr.append(str(input()))
newarr = [arr.count(i) for i in arr]
print(max(newarr))


a = [input() for i in range(int(input()))]
print(max([a.count(s) for s in a]))


n = int(input())
s = []
for i in range(n):
	s.append(input())
c = {}
for i in s:
	if any((i in d for d in c)):
		c[i] = c[i] + 1
	else:
		c[i] = 1
max = 1
for key in c:
	if c[key] > max:
		max = c[key]
print(max)


from collections import Counter
n = int(input())
a = []
for i in range(n):
	a.append(input())
x = Counter(a)
k = x.most_common(1)
for (i, j) in k:
	print(j)


from sys import stdin
n = int(stdin.readline())
d = {}
for i in range(0, n):
	st = stdin.readline()
	if st not in d:
		d[st] = 1
	else:
		d[st] += 1
print(max(d.values()))


maxRows = 1
n = int(input())
grid = []
for i in range(n):
	grid.append(input())
for i in range(n):
	if grid.count(grid[i]) > maxRows:
		maxRows = grid.count(grid[i])
print(maxRows)


n = int(input())
a = []
for i in range(n):
	a.append(input())
ans = 0
for i in range(n):
	cur_ans = 0
	for j in range(n):
		if a[i] == a[j]:
			cur_ans += 1
	ans = max(ans, cur_ans)
print(ans)


n = int(input())
str = [[0] * 110] * 110
for i in range(n):
	str[i] = input()
ans = 0
for i in range(n):
	sum = 0
	for j in range(n):
		if str[i] == str[j]:
			sum += 1
	ans = max(sum, ans)
print(ans)


n = int(input())
floor = []
for i in range(n):
	floor.append(input())
print(floor.count(max(set(floor), key=floor.count)))


import sys

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

def iinput():
	return int(input())

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

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
n = iinput()
d = {}
for _ in range(n):
	s = input()
	d[s] = d.get(s, 0) + 1
ans = 0
for key in d:
	ans = max(ans, d[key])
print(ans)


n = int(input())
room = []
locations = []
begin = 0
ends = []
for i in range(n):
	row = [int(x) for x in input()]
	location = []
	for j in range(n):
		if row[j] == 0:
			location.append(j)
	if location == []:
		begin += 1
	locations.append(location)
for i in locations:
	end = 0
	for j in locations:
		if j == i:
			end += 1
	ends.append(end)
print(max(begin, max(ends)))


a = int(input())
d = {}
for _ in ' ' * a:
	z = input()
	t = ()
	for i in range(a):
		if z[i] == '0':
			t += (i,)
	d[t] = d.get(t, 0) + 1
print(max(d.values()))


n = int(input())
grid = [input() for i in range(n)]
print(max([grid.count(i) for i in set(grid)]))


d = {}
for row in range(int(input())):
	current = input()
	d[current] = d[current] + 1 if d.get(current) else 1
print(max(d.values()))


from collections import Counter
n = int(input())
a = [input() for i in range(n)]
c = Counter(a)
print(c.most_common(1)[0][1])


a = list()
for i in range(int(input())):
	a.append(input())
ans = 0
for i in range(len(a)):
	ans = max(ans, a.count(a[i]))
print(ans)


import collections
n = int(input())
room = [input() for i in range(n)]
counter = collections.Counter(room)
print(max(counter.values()))


from collections import Counter
n = int(input())
grid = []
for i in range(n):
	grid.append(input())
print(Counter(grid).most_common(1)[0][1])


n = int(input())
c = []
for i in range(n):
	c.append(input())
max_count = 0
for i in range(n):
	count = 0
	for j in range(n):
		if c[i] == c[j]:
			count += 1
	if count > max_count:
		max_count = count
print(max_count)


ii = lambda : int(input())
si = lambda : input()
r = [si() for _ in range(ii())]
print(max((r.count(i) for i in r)))