Valera runs a 24/7 fast food cafe. He magically learned that next day n people will visit his cafe. For each person we know the arrival time: the i-th person comes exactly at h_{i} hours m_{i} minutes. The cafe spends less than a minute to serve each client, but if a client comes in and sees that there is no free cash, than he doesn't want to wait and leaves the cafe immediately. 

Valera is very greedy, so he wants to serve all n customers next day (and get more profit). However, for that he needs to ensure that at each moment of time the number of working cashes is no less than the number of clients in the cafe. 

Help Valera count the minimum number of cashes to work at his cafe next day, so that they can serve all visitors.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^5), that is the number of cafe visitors.

Each of the following n lines has two space-separated integers h_{i} and m_{i} (0 ≤ h_{i} ≤ 23; 0 ≤ m_{i} ≤ 59), representing the time when the i-th person comes into the cafe. 

Note that the time is given in the chronological order. All time is given within one 24-hour period.


-----Output-----

Print a single integer — the minimum number of cashes, needed to serve all clients next day.


-----Examples-----
Input
4
8 0
8 10
8 10
8 45

Output
2

Input
3
0 12
10 11
22 22

Output
1



-----Note-----

In the first sample it is not enough one cash to serve all clients, because two visitors will come into cafe in 8:10. Therefore, if there will be one cash in cafe, then one customer will be served by it, and another one will not wait and will go away.

In the second sample all visitors will come in different times, so it will be enough one cash.

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
a = int(input())
r = []
k = 1
(b, c) = map(int, input().split())
for i in range(a - 1):
	(d, e) = map(int, input().split())
	if (b, c) == (d, e):
		k += 1
	else:
		r.append(k)
		k = 1
	(b, c) = (d, e)
r.append(k)
print(max(r))


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


n = int(input())
(lh, lm) = (-1, -1)
(cnt, maxcnt) = (0, 0)
for i in range(n):
	(h, m) = map(int, input().split())
	if h == lh and m == lm:
		cnt += 1
		if cnt > maxcnt:
			maxcnt = cnt
	else:
		cnt = 0
		(lh, lm) = (h, m)
print(maxcnt + 1)


n = int(input())
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	k = h * 60 + m
	if k in d.keys():
		d[k] += 1
	else:
		d[k] = 1
t = int(max(d.values()))
print(t)


d = {}
ans = 0
for i in range(int(input())):
	(x, y) = map(int, input().split())
	d[x * 60 + y] = d.get(x * 60 + y, 0) + 1
	ans = max(ans, d[x * 60 + y])
print(ans)


n = int(input())
arr = []
for i in range(0, n):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	x = x * 60
	arr.append(x + y)
c = 1
val = arr[0]
pos = 1
o = 1
while pos < n:
	if arr[pos] == val:
		c = c + 1
	else:
		c = 1
		val = arr[pos]
	pos = pos + 1
	o = max(o, c)
print(o)


n = int(input())
x = [0] * 1440
while n:
	(h, m) = map(int, input().split())
	x[h * 60 + m] += 1
	n -= 1
print(max(x))


n = int(input())
per = {}
for i in range(n):
	m = tuple(input().split())
	if m not in per.keys():
		per[m] = 1
	else:
		per[m] += 1
print(max(per.values()))


n = int(input())
dict = {}
cash = set()
for i in range(n):
	lis = tuple(map(int, input().split()))
	if lis not in dict:
		dict[lis] = 1
		cash.add(lis)
	else:
		dict[lis] += 1
max = 0
for i in cash:
	if dict[i] > max:
		max = dict[i]
print(max)


n = int(input())
q = 1
h1 = -1
m1 = -1
d = 1
for i in range(n):
	(h, m) = map(int, input().split())
	if h == h1 and m == m1:
		d += 1
	else:
		h1 = h
		m1 = m
		if d > q:
			q = d
		d = 1
if d > q:
	q = d
print(q)


n = int(input())
b = input()
max = 0
count = 1
for i in range(n - 1):
	a = input()
	if b == a:
		count += 1
	else:
		b = a
		if count > max:
			max = count
		count = 1
if count > max:
	max = count
print(max)


n = int(input())
ans = 1
cnt = 1
(a, b) = input().split()
for _ in range(n - 1):
	(x, y) = input().split()
	if (x, y) == (a, b):
		cnt += 1
	else:
		cnt = 1
	(a, b) = (x, y)
	ans = max(ans, cnt)
print(ans)


from collections import Counter
lst = []
for _ in range(int(input())):
	(h, n) = map(int, input().split())
	lst.append('{}.{}'.format(h, n))
print(max(Counter(lst).values()))


n = int(input())
count = 1
preva = -1
prevb = -1
max = 1
countm = 0
for i in range(n):
	(m, n) = map(int, input().split())
	if m == preva and n == prevb:
		max = max + 1
	else:
		max = 1
	preva = m
	prevb = n
	if max >= count:
		count = max
print(count)


import sys
import operator
N = int(sys.stdin.readline().strip())
times = {}
for t in range(1, N + 1):
	(h, m) = map(int, sys.stdin.readline().strip().split(' '))
	if (h, m) not in times:
		times[h, m] = 1
	else:
		times[h, m] = times[h, m] + 1
print(times[max(times, key=lambda k: times[k])])


n = int(input())
count = 1
a = (-1, -1)
maxi = -1
for _ in range(n):
	(h, m) = map(int, input().split())
	b = (h, m)
	if a == b:
		count += 1
	else:
		maxi = max(maxi, count)
		count = 1
		a = b
maxi = max(maxi, count)
print(maxi)


n = int(input().strip())
current = ''
output = 1
tmp1 = 1
for i in range(n):
	tmp = input()
	if current == tmp:
		tmp1 += 1
	else:
		current = tmp
		output = max(output, tmp1)
		tmp1 = 1
print(max(output, tmp1))


n = int(input())
cash = tmp = 1
time = []
d = 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)))


n = int(input())
hLast = 0
mLast = 0
count = 1
countMax = 1
for i in range(n):
	(h, m) = map(int, input().split())
	if i == 0:
		hLast = h
		mLast = m
	elif hLast == h and mLast == m:
		count += 1
		if i == n - 1:
			if countMax < count:
				countMax = count
	else:
		if countMax < count:
			countMax = count
		count = 1
		hLast = h
		mLast = m
print(countMax)


n = int(input())
res = 1
(h, m) = map(int, input().split())
(h1, m1) = (h, m)
g = 1
for i in range(n - 1):
	(h, m) = map(int, input().split())
	if h == h1 and m == m1:
		g += 1
		if g > res:
			res = g
	else:
		g = 1
	(h1, m1) = (h, m)
print(res)


import sys
n = int(eval(input()))
c = 1
a = [0] * 60 * 24
for i in range(n):
	nums = list(map(int, input().split()))
	a[nums[0] * 60 + nums[1]] += 1
for i in range(60 * 24):
	c = max(c, a[i])
print(c)


a = int(input())
t = []
k = 1
k1 = 1
b1 = ''
for i in range(a):
	b = input()
	if b == b1:
		k1 += 1
	else:
		k1 = 1
	if k1 > k:
		k = k1
	b1 = b
print(k)


from collections import *
import sys
print(Counter(sys.stdin.readlines()).most_common(1)[0][1])


def main():
	from collections import Counter
	n = int(input())
	l = [0] * n
	for i in range(n):
		li = list(map(int, input().split()))
		l[i] = li[0] * 60 + li[1]
	cc = Counter(l)
	print(max(cc.values()))
main()


t = int(input())
l = []
for i in range(t):
	(a, b) = map(int, input().split())
	l.append([a, b])
d = l[0]
count = 0
maxa = 0
for i in l:
	if d == i:
		count += 1
	else:
		maxa = max(maxa, count)
		count = 1
		d = i
maxa = max(count, maxa)
print(maxa)


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


import sys
import math
n = int(input())
comma = []
for _ in range(n):
	(h, m) = map(int, input().split())
	comma.append(h * 60 + m)
comma = sorted(comma)
freqa = 1
maxa = 0
for i in range(1, n):
	prev = comma[i - 1]
	if comma[i] == prev:
		freqa += 1
	else:
		if freqa > maxa:
			maxa = freqa
		freqa = 1
if freqa > maxa:
	maxa = freqa
print(maxa)


k = int(input())
kol = 0
max = 0
hp = 0
mp = 100
for i in range(k):
	(h, m) = [int(i) for i in input().split()]
	if h == hp:
		if m == mp:
			kol += 1
			if kol > max:
				max = kol
		else:
			mp = m
			kol = 1
	else:
		hp = h
		mp = m
		kol = 1
	if kol > max:
		max = kol
print(max)


n = int(input())
maxx = 1
x = input().split()
A = [x]
ans = 1
for i in range(n - 1):
	y = input().split()
	if y == A[-1]:
		ans += 1
	else:
		ans = 1
	A.append(y)
	if ans > maxx:
		maxx = ans
print(maxx)


n = int(input())
d = {}
while n > 0:
	(h, m) = map(int, input().split())
	hm = h * 60 + m
	d[hm] = d.get(hm, 0) + 1
	n -= 1
print(max(d.values()))


n = int(input())
a = input()
c = a
contador = 1
my = 1
for i in range(n - 1):
	a = input()
	if c == a:
		contador = contador + 1
		if contador > my:
			my = contador
	else:
		contador = 1
	c = a
print(my)


n = int(input())
dict1 = {}
max = 0
for i in range(n):
	tup = tuple(input().split(' '))
	if dict1.get(tup, 0):
		dict1[tup] += 1
	else:
		dict1[tup] = 1
	if dict1[tup] > max:
		max = dict1[tup]
print(max)


c = ''
m = 0
b = 0
for i in range(int(input())):
	s = input()
	if s == c:
		b += 1
	else:
		if b > m:
			m = b
		c = s
		b = 1
print(max(m, b))


n = int(input())
a = -1
b = -1
m = 1
c = 1
for i in range(n):
	(x, y) = map(int, input().split())
	if x == a and y == b:
		c += 1
	else:
		c = 1
	a = x
	b = y
	if c > m:
		m = c
print(m)


def readln():
	return tuple(map(int, input().split()))
(n,) = readln()
cnt = {}
for _ in range(n):
	hm = readln()
	cnt[hm] = cnt.get(hm, 0) + 1
print(max(cnt.values()))


c = 0
d = {}
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if str([n, m]) in d:
		d[str([n, m])] += 1
	else:
		d[str([n, m])] = 1
for x in d:
	if d[x] > c:
		c = d[x]
print(c)


dict = {}
for x in range(int(input())):
	s = input()
	if not s in dict.keys():
		dict[s] = 1
	else:
		dict[s] += 1
print(max(dict.values()))


from collections import Counter
n = int(input())
l = []
for _ in range(n):
	(h, m) = [int(x) for x in input().split()]
	l.append(h * 60 + m)
cc = Counter(l)
print(max(cc.values()))


n = int(input())
l = []
while n:
	(h, m) = map(int, input().split())
	l.append((h, m))
	n = n - 1
l.sort()

def mostFrequent(arr, n):
	Hash = dict()
	for i in range(n):
		if arr[i] in Hash.keys():
			Hash[arr[i]] += 1
		else:
			Hash[arr[i]] = 1
	max_count = 0
	res = -1
	for i in Hash:
		if max_count < Hash[i]:
			res = i
			max_count = Hash[i]
	return res
z = mostFrequent(l, len(l))
if len(set(l)) == len(l):
	print('1')
else:
	z1 = l.count(z)
	print(z1)


n = int(input())
ans = 1
count = {}
while n >= 1:
	n -= 1
	(a, b) = map(int, input().split())
	tmp = a * 60 + b
	if tmp in count:
		count[tmp] += 1
	else:
		count[tmp] = 1
print(max(count.values()))


n = int(input())
times = []
for i in range(0, n):
	arr = [int(x) for x in input().strip().split()]
	times.append(arr)
min_c = -10 ** 8
c = 1
if n == 1:
	print(c)
else:
	for i in range(1, n):
		if times[i][0] == times[i - 1][0] and times[i][1] == times[i - 1][1]:
			c += 1
		else:
			c = 1
		min_c = max(min_c, c)
	print(min_c)


n = int(input())
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
(r, t) = (0, 1)
for i in range(n - 1):
	if l[i][0] == l[i + 1][0] and l[i][1] == l[i + 1][1]:
		t += 1
	else:
		if t > r:
			r = t
		t = 1
if t > r:
	r = t
print(r)


n = int(input().rstrip())
arr = list()
result = list()
count = 1
for i in range(n):
	temp = list(map(int, input().rstrip().split()))
	arr.append(temp)
	if i > 0:
		if arr[i] == arr[i - 1]:
			count += 1
		else:
			result.append(count)
			count = 1
result.append(count)
print(max(result))


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

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

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

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

def valid(row, col, rows, cols, rcross, lcross):
	return rows[row] == 0 and cols[col] == 0 and (rcross[col + row] == 0) and (lcross[col - row] == 0)

def div(n):
	if n == 1:
		return 1
	cnt = 2
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			if i != n // i:
				cnt += 2
			else:
				cnt += 1
	return cnt

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		flag = True
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				flag = False
				break
		return flag

def s(b):
	ans = []
	while b > 0:
		tmp = b % 10
		ans.append(tmp)
		b = b // 10
	return ans

def main():
	n = ii()
	d = defaultdict(int)
	for i in range(n):
		(h, m) = mi()
		d[h, m] += 1
	print(max(d.values()))
main()


n = int(input())
a = [0] * (24 * 60)
for i in range(n):
	(c, d) = map(int, input().split())
	a[c * 60 + d] += 1
print(max(a))


n = int(input())
c = 1
d = 1
l = ['hi', 'hi']
for i in range(n):
	new = list(map(int, input().split()))
	if new == l:
		d += 1
		c = max(c, d)
	else:
		d = 1
		l[0] = new[0]
		l[1] = new[1]
print(c)


n = int(input())
_a = -1
_b = -1
ans = 1
temp = 1
for i in range(n):
	(a, b) = map(int, input().split())
	if a == _a and b == _b:
		temp += 1
		ans = max(ans, temp)
	else:
		_a = a
		_b = b
		temp = 1
print(ans)


n = int(input())
count = 1
prev = input().split()
maxc = count
for i in range(n - 1):
	cur = input().split()
	if prev == cur:
		count += 1
	else:
		if count > maxc:
			maxc = count
		count = 1
	prev = cur
if count > maxc:
	maxc = count
print(maxc)


n = int(input())
(c, r) = (1, 1)
(h1, m1) = map(int, input().split())
for i in range(1, n):
	(h, m) = map(int, input().split())
	if h1 == h and m1 == m:
		c += 1
	else:
		(c, h1, m1) = (1, h, m)
	if c > r:
		r = c
print(r)


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


n = int(input())
(h0, m0) = map(int, input().split())
k = 0
f = 0
for i in range(n - 1):
	(h, m) = map(int, input().split())
	if h0 == h and m0 == m:
		f += 1
	else:
		f = 0
	if k < f:
		k = f
	h0 = h
	m0 = m
print(k + 1)


n = int(input())
l = []
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	if (h, m) not in d.keys():
		d[h, m] = 1
	else:
		d[h, m] += 1
mx = -1
for key in d.keys():
	if d[key] > mx:
		mx = d[key]
print(mx)


from collections import Counter
n = int(input())
l = []
for _ in range(n):
	li = list(map(int, input().split()))
	l.append(li[0] * 60 + li[1])
cc = Counter(l)
print(max(cc.values()))


n = int(input())
clients = []
max_ = 1
for _ in range(n):
	(h, m) = list(map(int, input().split()))
	while len(clients) > 0:
		if clients[0][0] < h or (clients[0][0] == h and clients[0][1] < m):
			del clients[0]
		else:
			break
	clients.append((h, m))
	max_ = max(max_, len(clients))
print(max_)


tmp = dict()
for i in range(int(input())):
	(h, m) = map(int, input().split())
	if (h, m) in tmp.keys():
		tmp[h, m] += 1
	else:
		tmp[h, m] = 1
print(max(tmp.values()))


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


class CodeforcesTask237ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.arrivals = []

	def read_input(self):
		self.n = int(input())
		for x in range(self.n):
			self.arrivals.append([int(y) for y in input().split(' ')])

	def process_task(self):
		times = [0] * (24 * 60)
		for arr in self.arrivals:
			times[arr[0] * 60 + arr[1]] += 1
		self.result = str(max(times))

	def get_result(self):
		return self.result
Solution = CodeforcesTask237ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


entrada = int(input())
garcom = 0
clientes = []
for i in range(entrada):
	clientes.append(tuple([int(x) for x in input().split()]))
stack = clientes[0]
qtd = 1
for i in range(1, entrada):
	if clientes[i] == stack:
		qtd += 1
	else:
		stack = clientes[i]
		if qtd > garcom:
			garcom = qtd
		qtd = 1
if qtd > garcom:
	garcom = qtd
print(garcom)


t = int(input())
list = []
for i in range(t):
	(h, m) = [int(x) for x in input().split()]
	list.append((h, m))
list.sort()
c = 1
m = 1
l = len(list)
for i in range(l - 1):
	if list[i] == list[i + 1]:
		c += 1
	else:
		m = max(m, c)
		c = 1
print(max(m, c))


n = int(input())
box = []
dic = {}
mylist = []
for i in range(n):
	(x, y) = map(int, input().split(' '))
	time = (x, y)
	box.append(time)

def mycount(n):
	for item in n:
		if item in dic:
			dic[item] += 1
		else:
			dic[item] = 1
	for (k, v) in dic.items():
		mylist.append(v)
	return max(mylist)
res = mycount(box)
print(res)


n = int(input())
ans = 1
prev = ''
cur = 1
for _ in range(n):
	s = input()
	if s == prev:
		cur += 1
		ans = max(ans, cur)
	else:
		cur = 1
		prev = s
print(ans)


from collections import Counter
n = int(input())
times = list()
for i in range(n):
	t = input()
	times.append(t)
frequency = Counter(times)
result = max(frequency.values())
print(result)


n = int(input())
a = []
for i in range(n):
	a.append(input().split())
m = 1
t = 1
for i in range(1, n):
	if a[i] == a[i - 1]:
		t += 1
	else:
		t = 1
	if t > m:
		m = t
print(m)


n = int(input())
if n == 0:
	print(0)
	exit(0)
h = list()
m = list()
for i in range(n):
	tmp = input().split()
	h.append(int(tmp[0]))
	m.append(int(tmp[1]))
cash = 1
c = 1
for i in range(n - 1):
	if h[i] == h[i + 1] and m[i] == m[i + 1]:
		c = c + 1
		if c > cash:
			cash = c
	else:
		c = 1
print(cash)


maximum = 1
l = [0]
sum = 1
for _ in range(int(input())):
	x = input()
	l.append(x)
	if x == l[-2]:
		sum += 1
		if sum > maximum:
			maximum = sum
	else:
		sum = 1
print(maximum)


n = int(input())
res = 0
tmp = 0
(a1, b1) = (0, 0)
(a2, b2) = (-1, -1)
for _ in range(n):
	(a1, b1) = map(int, input().split())
	if a1 != a2 or b1 != b2:
		tmp = 0
	if a1 == a2 and b1 == b2:
		tmp += 1
		res = max(res, tmp)
	(a2, b2) = (a1, b1)
print(res + 1)


n = int(input())
ttt = []
cassa = 1
cassa_tmp = 1
old_time = -1
for i in range(n):
	(h, m) = map(int, input().split())
	ttime = h * 60 + m
	if ttime == old_time:
		cassa_tmp += 1
		if cassa_tmp > cassa:
			cassa = cassa_tmp
	else:
		old_time = ttime
		cassa_tmp = 1
print(cassa)


from statistics import *
n = int(input())
l = []
for i in range(n):
	(x, y) = map(int, input().split())
	l.append((x, y))
print(l.count(mode(l)))


l = [0] * 60 * 24
n = int(input())
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	l[a * 60 + b] += 1
print(max(l))


n = int(input())
(hi, mi, hf, mf, cash, cnt) = (0, 0, 0, 0, 1, 1)
for i in range(n):
	if i == 0:
		(hi, mi) = map(int, input().split())
	else:
		(hf, mf) = map(int, input().split())
		if hf == hi and mf == mi:
			cnt += 1
			if cnt > cash:
				cash = cnt
		else:
			cnt = 1
		hi = hf
		mi = mf
print(cash)


n = int(input())
L = [list(map(int, input().split())) for _ in range(n)]
r = 1
e = 1
c = L[0]
for i in range(1, n):
	if L[i] == c:
		e += 1
	else:
		r = max(r, e)
		e = 1
		c = L[i]
print(max(r, e))


import sys
input = sys.stdin.readline
n = int(input())
d = {}
for _ in range(n):
	t = input()
	if t in d:
		d[t] += 1
	else:
		d[t] = 1
print(max(d.values()))


d = {}
for _ in [0] * int(input()):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
print(max(d.values()))


n = int(input())
f = []
count = 1
c = 0
for i in range(n):
	(a, b) = map(str, input().split())
	if c == a + b:
		count += 1
		f.append(count)
	else:
		count = 1
	c = a + b
if len(f) > 0:
	print(max(f))
else:
	print(1)


n = int(input())
(prev, curr) = ([], [])
count = 1
mini = 1
prev = [int(x) for x in input().split()]
for i in range(1, n):
	curr = [int(x) for x in input().split()]
	if prev == curr:
		count += 1
	if count > mini:
		mini = count
	if prev != curr:
		count = 1
	prev = curr
print(mini)


import math
z = int(input())
n = 0
j = 0
hl = 99
ml = 99
for i in range(z):
	[h, m] = map(int, input().split())
	if h * 60 + m != hl * 60 + ml:
		hl = h
		ml = m
		j = 1
	else:
		j = j + 1
	if j > n:
		n = j
print(n)


n = int(input())
t = 0
time = {}
while t < n:
	a = input()
	if a not in time:
		time[a] = 1
	else:
		time[a] += 1
	t = t + 1
cash = 1
for i in time:
	cash = max(cash, time[i])
print(cash)


n = int(input())
i = 0
num = list()
while i < n:
	num.append(input())
	i += 1
arr = []
for i in num:
	count = 0
	for j in range(0, len(i)):
		if i[j] == ' ':
			arr.append(int(i[count:j]))
			count = j + 1
		elif j == len(i) - 1:
			arr.append(int(i[count:len(i)]))
cash = 1
count = 1
for i in range(0, len(arr) - 3, 2):
	if arr[i] == arr[i + 2] and arr[i + 1] == arr[i + 3]:
		count += 1
		if i == len(arr) - 4:
			if count > cash:
				cash = count
	else:
		if count > cash:
			cash = count
		count = 1
print(cash)


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


l = [[0 for b in range(0, 60)] for a in range(0, 24)]
for _ in range(0, int(input())):
	(h, m) = map(int, input().strip().split())
	l[h][m] += 1
res = 0
for i in l:
	for j in i:
		res = max(res, j)
if res == 0:
	print(0)
if res != 0:
	print(res)


w = int(input())
l = input()
c = 1
r = 1
for x in range(w - 1):
	n = input()
	if n == l:
		r += 1
	else:
		r = 1
	if r > c:
		c = r
	l = n
print(c)


n = int(input())
l = 1
y = 1
x = -1
for i in range(n):
	(k, m) = map(int, input().split())
	m += k * 60
	if x == m:
		y += 1
	else:
		x = m
		l = max(l, y)
		y = 1
if y > l:
	l = y
print(l)


n = int(input())
times = {}
for i in range(n):
	t = input()
	try:
		times[t] += 1
	except KeyError:
		times[t] = 1
		pass
cashers = max(times.values())
print(cashers)


n = int(input())
d = {}
for i in range(n):
	(x, y) = map(int, input().split())
	x = (x, y)
	if x not in d:
		d[x] = 1
	else:
		d[x] += 1
max = 0
for i in d.values():
	if max < i:
		max = i
print(max)


cnt = {}
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if (x, y) in cnt:
		cnt[x, y] += 1
	else:
		cnt[x, y] = 1
print(max(cnt.values()))


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


def main():
	from sys import stdin
	from collections import Counter
	print(Counter(stdin.readlines()).most_common(1)[0][1])
main()


ab = []
d = {}
for t in range(int(input())):
	(a, b) = map(int, input().split())
	ab.append([a, b])
	if (a, b) in d:
		d[a, b] += 1
	else:
		d[a, b] = 1
z = max(d, key=d.get)
print(d[z])


lst = []
dct = {}
count = 0
for i in range(int(input())):
	time = str(input().split())
	lst.append(time)
for i in lst:
	if i in dct:
		dct[i] += 1
	else:
		dct[i] = 1
print(max(dct.values()))


n = int(input())
inputs = {}
for _n in range(n):
	time = input()
	if time in inputs:
		inputs[time] += 1
	else:
		inputs[time] = 1
cash = 0
for time in inputs:
	if inputs[time] > cash:
		cash = inputs[time]
print(cash)


n = int(input())
(ch, cm) = map(int, input().split())
cnt = 1
ans = 1
for _ in range(n - 1):
	(h, m) = map(int, input().split())
	if h == ch and m == cm:
		cnt += 1
	elif cnt > ans:
		ans = cnt
		cnt = 1
	else:
		cnt = 1
	(ch, cm) = (h, m)
print(cnt if cnt > ans else ans)


from sys import stdin, stdout
import math
import bisect
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	n = int(input())
	d = {}
	for i in range(n):
		t = tuple(map(int, input().split()))
		if t in d:
			d[t] += 1
		else:
			d[t] = 1
	print(max(d.values()))
tt = 1
for __ in range(tt):
	solve()


n = int(input())
i = 0
b = 1
bg = 1
a = []
while i < n:
	(h, m) = map(int, input().split())
	a.append(h * 60 + m)
	i += 1
a.sort()
i = 1
while i < len(a):
	if a[i] == a[i - 1]:
		b += 1
	else:
		if b > bg:
			bg = b
		b = 1
	i += 1
print(max(b, bg))


def free_cash(array):
	count = 1
	arr = []
	for i in range(len(array) - 1):
		if array[i] == array[i + 1]:
			count += 1
		else:
			arr.append(count)
			count = 1
	arr.append(count)
	print(max(arr))
n = input()
array = []
for i in range(int(n)):
	(n, m) = input().split()
	array.append(n + ':' + m)
free_cash(array)


n = input()
if int(n) == 0:
	print(0)
else:
	maxcnt = 1
	cnt = 1
	tmp = [0, 0]
	for i in range(int(n)):
		(h, m) = input().split()
		if i == 0:
			(tmp[0], tmp[1]) = (int(h), int(m))
		elif int(h) == tmp[0] and int(m) == tmp[1]:
			cnt += 1
		else:
			maxcnt = max(maxcnt, cnt)
			cnt = 1
			(tmp[0], tmp[1]) = (int(h), int(m))
	maxcnt = max(maxcnt, cnt)
	print(maxcnt)


from collections import Counter
a = []
for _ in range(int(input())):
	s = input()
	a.append(s)
d = Counter(a)
c = 1
m = max(d.values())
c += m - 1
print(c)


import sys
import time
import os
from math import sqrt, log, log2, ceil, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
d = defaultdict(int)

def solve():
	for i in range(iinp()):
		(hi, mi) = mint()
		d[hi * 60 + mi] += 1
	m = 0
	for v in d.values():
		m = max(m, v)
	print(m)
t = 1
for _ in range(t):
	solve()


l = []
for _ in range(int(input())):
	(m, n) = map(int, input().split())
	l.append([m, n])
c = 1
m = 1
for i in range(1, len(l)):
	if l[i - 1][0] == l[i][0] and l[i - 1][1] == l[i][1]:
		c += 1
		m = max(m, c)
	else:
		c = 1
print(m)


import collections

def solve(pairs):
	tups = [tuple(pair) for pair in pairs]
	return max(collections.Counter(tups).values())

def main():
	n = int(input())
	customer_arrivals = [[int(i) for i in input().strip().split()] for _ in range(n)]
	result = solve(customer_arrivals)
	print(result)
main()


def repeatedHour():
	n = int(input())
	hours = []
	repeatedHours = [1, 1]
	for i in range(n):
		temp = input()
		if temp in hours:
			repeatedHours[0] += 1
			if repeatedHours[0] > repeatedHours[1]:
				repeatedHours[1] = repeatedHours[0]
		else:
			hours.append(temp)
			repeatedHours[0] = 1
	return repeatedHours[1]

def numberCashers():
	print(repeatedHour())
numberCashers()


n = int(input())
cash = int(n > 0)
best = cash
prev = []
for i in range(n):
	time = [int(i) for i in input().split()]
	if i > 0:
		if time == prev:
			cash += 1
		else:
			cash = 1
	prev = time
	best = max(best, cash)
print(best)


import statistics
from statistics import mode
a = int(input())
d = []
for i in range(0, a):
	b = str(input())
	d.append(b)
e = mode(d)
print(d.count(e))


from sys import stdin
n = int(stdin.readline().rstrip())
lh = -1
lm = -1
ls = 1
ms = 1
for _ in range(n):
	(h, m) = map(int, stdin.readline().rstrip().split(' '))
	h = int(h)
	m = int(m)
	if lh == h and lm == m:
		ls += 1
	else:
		ms = max(ls, ms)
		ls = 1
	lh = h
	lm = m
print(max(ms, ls))


def kassy(lst):
	(x, y) = (-1, -1)
	(flag, count) = (0, 0)
	for elem in lst:
		if elem[0] == x and elem[1] == y:
			flag += 1
		else:
			flag = 1
		if flag > count:
			count = flag
		(x, y) = (elem[0], elem[1])
	return count
n = int(input())
b = list()
for i in range(n):
	t = [int(i) for i in input().split()]
	b.append(tuple(t))
print(kassy(b))


from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
flush = stdout.flush
OUT = []

def write(item, sep=' '):
	if type(item) is int:
		OUT.append(str(item))
	elif type(item) is list:
		if type(item[0]) is int:
			OUT.append(sep.join(map(str, item)))
		else:
			OUT.append(sep.join(item))
	else:
		OUT.append(item)

def PRINT():
	print('\n'.join(OUT))
GI = lambda : int(input())
GS = lambda : input()[:-1]
gi = lambda : list(map(int, input().split()))
gs = lambda : input().split()
n = GI()
m = 1
c = 1
prev = (-1, -1)
for i in range(n):
	a = gi()
	if a == prev:
		c += 1
	else:
		prev = a
		c = 1
	m = max(m, c)
write(m)
PRINT()


t = int(input())
m = 0
k = 0
g = ''
for i in range(0, t):
	p = input().strip()
	if p == g:
		k += 1
	else:
		m = max(k, m)
		k = 1
		g = p
m = max(k, m)
print(str(m))


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


from sys import stdin

def solve():
	t = int(input())
	if t == 1:
		return 1
	mc = 1
	c = 1
	prev = str(input())
	for i in range(1, t):
		s = str(input())
		if s == prev:
			c += 1
			mc = max(mc, c)
		else:
			c = 1
		prev = s
	return mc
print(solve())


(cashes, c, last) = (1, 1, '')
for x in range(int(input())):
	current = input()
	if current == last:
		c += 1
	else:
		cashes = c if c > cashes else cashes
		c = 1
	last = current
print(max(c, cashes))


from collections import Counter as c
n = int(input())
table = []
for _ in range(n):
	(i, j) = map(int, input().split())
	table.append((i, j))
print(max(c(table).values()))


import collections
n = int(input())
a = []
b = []
for i in range(n):
	a.append(list(map(int, input().strip().split())))
	b.append(a[i][0] + a[i][1] / 60)
counter = collections.Counter(b)
d = max(counter.values())
print(d)


n = int(input())
cashiers = {}
for i in range(n):
	args = input().split()
	cashiers[':'.join(args)] = cashiers.get(':'.join(args), 0) + 1
print(max(cashiers.values()))


n = int(input())
maxCount = -1
count = 1
prevMin = -1
for _ in range(n):
	(h, m) = list(map(int, input().split()))
	m = 60 * h + m
	if prevMin == m:
		count = count + 1
	else:
		if maxCount < count:
			maxCount = count
		count = 1
	prevMin = m
if maxCount < count:
	maxCount = count
print(maxCount)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

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

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

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
from collections import Counter
nb_peoples = read_int()
times = []
for _ in range(nb_peoples):
	times.append(read_str())
print(Counter(times).most_common()[0][1])


import sys
n = int(sys.stdin.readline())
first_p = sys.stdin.readline().split()
count = 1
vmax = 0
for i in range(n - 1):
	second_p = sys.stdin.readline().split()
	if first_p[0] == second_p[0] and first_p[1] == second_p[1]:
		count += 1
	else:
		if count > vmax:
			vmax = count
		count = 1
	first_p = second_p
if count > vmax:
	vmax = count
print(vmax)


n = int(input())
cash = tmp = 1
time = []
for i in range(n):
	time.append(input())
time.append('x x')
count = 1
cash = 1
for i in range(n):
	if time[i] == time[i + 1]:
		count += 1
	else:
		cash = max(cash, count)
		count = 1
print(cash)


from sys import stdin

def main():
	l = [0] * 1441
	for _ in range(int(stdin.readline())):
		(h, m) = map(int, stdin.readline().split())
		m += h * 60
		l[m] += 1
		l[m + 1] -= 1
	m = n = 0
	for x in l:
		n += x
		if m < n:
			m = n
	print(m)
main()


n = int(input())
count = 1
max = 1
(preva, prevb) = (int(a) for a in input().split())
for i in range(n - 1):
	(curra, currb) = (int(a) for a in input().split())
	if curra == preva and currb == prevb:
		count += 1
		if count > max:
			max = count
	else:
		count = 1
	(preva, prevb) = (curra, currb)
print(max)


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


import sys
import time
import os
from math import sqrt, log, log2, ceil, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

def bs(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	p = int(sqrt(n))
	for i in range(5, p + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def solve():
	n = iinp()
	arr = []
	for i in range(n):
		(a, b) = mint()
		arr.append(a * 100 + b)
	c = Counter(arr)
	print(max(c.values()))
start_time = time.time()
solve()


counts = [0] * 1440
for _ in range(int(input())):
	(h, m) = map(int, input().split())
	counts[h * 60 + m] += 1
print(max(counts))


n = int(input())
ans = 1
a = 1
(h, m) = map(int, input().split())
for i in range(n - 1):
	(h1, m1) = map(int, input().split())
	if h == h1 and m1 == m:
		a += 1
	else:
		a = 1
	h = h1
	m = m1
	ans = max(ans, a)
print(ans)


n = int(input())
cnt = 0
a = {}
for i in range(n):
	x = input()
	if x in a:
		a[x] += 1
	else:
		a[x] = 1
	if a[x] > cnt:
		cnt = a[x]
print(cnt)


n = int(input())
last = -1
ans = 0
strike = 1
for i in range(n):
	(h, m) = map(int, input().split())
	if last == h * 60 + m:
		strike += 1
	else:
		ans = max(strike, ans)
		strike = 1
		last = h * 60 + m
print(max(ans, strike))


n = int(input())
l = []
d = dict()
for i in range(n):
	s = tuple(map(int, input().split()))
	l.append(s)
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
print(max(list(d.values())))


visitors = int(input())
(prev_h, prev_m) = [int(i) for i in input().split()]
count = 1
max_count = 1
for visit in range(1, visitors):
	(h, m) = [int(i) for i in input().split()]
	if h == prev_h and m == prev_m:
		count += 1
		if count > max_count:
			max_count = count
	else:
		count = 1
	prev_h = h
	prev_m = m
print(max_count)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

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

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

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

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

def main():
	cashes = 1
	my_dict = defaultdict(int)
	for i in range(ii()):
		(h, m) = mi()
		x = h * 60 + m
		my_dict[x] += 1
	print(max(my_dict.values()))
main()


n = int(input())
time = [[-1, -1]]
cash = []
num = 1
for i in range(n):
	time.append([int(x) for x in input().split()])
for i in range(1, n + 1):
	if time[i] == time[i - 1]:
		num = num + 1
	else:
		num = 1
	cash.append(num)
print(max(cash))


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


n = int(input())
d = {}
for i in range(n):
	a = tuple(map(int, input().split()))
	d[a] = d.get(a, 0) + 1
print(max(d.values()))


a = [0] * (24 * 60)
n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	a[x * 60 + y] += 1
print(max(a))


n = int(input())
res = 1
aux = 1
(h1, m1) = [int(i) for i in input().split()]
for _ in range(n - 1):
	(h2, m2) = [int(i) for i in input().split()]
	if h1 == h2 and m1 == m2:
		aux += 1
		if aux > res:
			res = aux
	else:
		aux = 1
	(h1, m1) = (h2, m2)
print(str(res))


n = int(input())
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	d[h, m] = d.get((h, m), 0) + 1
mx = 1
for (ele1, ele2) in d:
	mx = max(mx, d[ele1, ele2])
print(mx)


n = int(input())
max = 1
a = input()
counter = 1
for i in range(n - 1):
	c = input()
	if a == c:
		counter += 1
		if counter > max:
			max = counter
	else:
		a = c
		counter = 1
print(max)


(n, g, c, nn) = (int(input()) - 1, input(), 1, 1)
for i in range(n):
	gg = input()
	if g == gg and nn >= c:
		c += 1
		nn += 1
	elif g == gg:
		nn += 1
	else:
		g = gg
		nn = 1
print(c)


n = int(input())
lis = []
i = 0
k = [0]
for x in range(n):
	lis.append(input())
	if x != 0 and lis[x - 1] == lis[x]:
		if lis[x] == rep:
			k[i] += 1
		else:
			k.append(1)
			i += 1
			rep = lis[x]
	elif x == 0:
		rep = lis[x]
print(max(k) + 1)


n = int(input())
arr = dict()
for _ in range(n):
	k = input()
	if k in arr:
		arr[k] += 1
	else:
		arr[k] = 1
ans = 0
for key in arr:
	if arr[key] > ans:
		ans = arr[key]
print(ans)


ddict = {}
for i in range(int(input())):
	a = input()
	try:
		ddict[a] += 1
	except:
		ddict[a] = 1
print(max(list(ddict.values())))


def main():
	from collections import defaultdict
	(n, ans) = (int(input()), 0)
	hour = defaultdict(int)
	for i in range(n):
		hi = input()
		hour[hi] += 1
		if hour[hi] > ans:
			ans = hour[hi]
	print(ans)
main()


n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(int, input().split())))
arr.sort()
count = 1
max1 = 1
for i in range(1, n):
	if arr[i][0] == arr[i - 1][0] and arr[i][1] == arr[i - 1][1]:
		count += 1
		if max1 < count:
			max1 = count
	else:
		count = 1
print(max1)


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


n = int(input())
l = []
max = 1
l2 = []
cnt = 1
for i in range(n):
	d = list(map(int, input().split()))
	if d == l2:
		cnt += 1
		if max < cnt:
			max = cnt
	else:
		cnt = 1
	l2 = d
print(max)


from collections import Counter as c
n = int(input())
v = []
z = 1
ans = 0
for i in range(n):
	(a, b) = map(int, input().split())
	v.append(60 * a + b)
d = c(v)
print(max(d.values()))


n = int(input())
ar = []
for x in range(n):
	(c, d) = map(int, input().split())
	ar.append(c * 60 + d)
cur = 1
ma = 1
for x in range(1, n):
	if ar[x] == ar[x - 1]:
		cur += 1
	else:
		if cur > ma:
			ma = cur
		cur = 1
if cur > ma:
	ma = cur
print(ma)


n = int(input())
time = []
while n > 0:
	i = input().split()
	(x, y) = (int(i[0]), int(i[1]))
	time.append(x * 60 + y)
	n -= 1
time.sort()
cashes = 0
count = 1
last = time[0]
for i in range(1, len(time)):
	if last != time[i]:
		last = time[i]
		if cashes < count:
			cashes = count
		count = 1
	else:
		count += 1
if cashes < count:
	cashes = count
print(cashes)


import copy
timings = []
overlap = 1
finalCount = 1
prev = []
for i in range(int(input())):
	tmp = input().split()
	if prev == tmp:
		overlap += 1
		if finalCount < overlap:
			finalCount = overlap
	else:
		overlap = 1
	prev = tmp
print(finalCount)


n = int(input())
ans = j = 1
prev = []
for i in range(n):
	new = list(map(int, input().split()))
	if new == prev:
		j += 1
	else:
		ans = max(ans, j)
		j = 1
	prev = new
print(max(ans, j))


n = int(input())
arr = []
for i in range(n):
	arr.append(''.join(input().split()))
maxcashes = 1
cashes = 1
for i in range(1, n):
	if arr[i] == arr[i - 1]:
		cashes += 1
		if cashes > maxcashes:
			maxcashes = cashes
	else:
		cashes = 1
print(maxcashes)


x = int(input())
horas = []
xSize = []
for i in range(24):
	horas.append([])
	xSize.append([])
for i in range(24):
	for j in range(60):
		horas[i].append(j)
		xSize[i].append(0)
for i in range(x):
	(horas, minutes) = list(map(int, input().split()))
	xSize[horas][minutes] += 1
aux = 0
for i in range(24):
	for j in range(60):
		if xSize[i][j] > aux:
			aux = xSize[i][j]
print(aux)


ct = 1
ans = 1
c = int(input())
bf = input()
for i in [0] * (c - 1):
	a = input()
	if a == bf:
		ct += 1
		ans += 1 if ct > ans else 0
	else:
		ct = 1
	bf = a
print(ans)


n = int(input())
t = []
for i in range(n):
	s = input()
	t.append(s)
if n > 0:
	cashneed = 1
	cashavailable = 1
	cash = 1
	for i in range(1, n):
		if t[i] == t[i - 1]:
			cashneed += 1
		else:
			cashneed = 1
		if cashneed > cashavailable:
			cash += cashneed - cashavailable
		cashavailable = cash
else:
	cash = 0
print(cash)


n = int(input())
mints = [0] * (24 * 60)
for i in range(n):
	(h, m) = map(int, input().split())
	mints[h * 60 + m] += 1
print(max(mints))


n = int(input())
cnt = [[0 for i in range(60)] for j in range(24)]
ans = 0
for i in range(n):
	(h, m) = map(int, input().split())
	cnt[h][m] += 1
	ans = max(ans, cnt[h][m])
print(ans)


n = int(input())
ans = 0
last = ''
cur = 0
for i in range(n):
	s = input()
	if s != last:
		last = s
		cur = 0
	cur += 1
	ans = max(ans, cur)
print(max(ans, cur))


n = int(input())
d = {}
for i in range(n):
	(a, b) = list(map(int, input().split()))
	if (a, b) not in d:
		d[a, b] = 1
	else:
		d[a, b] += 1
print(max(d.values()))


def main():
	clients = int(input())
	d = {}
	maximum = -1
	for i in range(clients):
		data = input()
		if data in d:
			d[data] += 1
		else:
			d[data] = 1
		maximum = max(maximum, d[data])
	print(maximum)
main()


from collections import Counter
n = int(input())
ar = []
s = set()
for i in range(n):
	(h, m) = map(int, input().split())
	x = h * 100 + m
	ar.append(x)
c = Counter(ar)
ans = max(list(c.values()))
print(ans)


n = int(input())
previous = input()
max = 1
cur_max = 1
for i in range(1, n):
	current = input()
	if current == previous:
		cur_max += 1
	else:
		previous = current
		if cur_max > max:
			max = cur_max
		cur_max = 1
if cur_max > max:
	max = cur_max
print(max)


n = int(input())
if n > 0:
	kmax = 1
k = 0
[hp, mp] = [-1, -1]
for i in range(n):
	[h, m] = list(map(int, input().split()))
	if [h, m] == [hp, mp]:
		k += 1
		if k > kmax:
			kmax = k
	else:
		[hp, mp] = [h, m]
		k = 1
print(kmax)


n = int(input())
t = [0] * 1440
for i in range(n):
	(a, b) = map(int, input().split())
	t[a * 60 + b] += 1
print(max(t))


n = int(input())
(h, m) = (0, 0)
(h_old, m_old) = (0, 0)
cass = 1
cas_t = []
for i in range(n):
	(h, m) = map(int, input().split())
	if i > 0:
		if h == h_old and m == m_old:
			cass += 1
		else:
			cas_t.append(cass)
			cass = 1
	(h_old, m_old) = (h, m)
cas_t.append(cass)
cass = 1
print(max(cas_t))


from collections import Counter
a = int(input())
sa = []
string = ''
bad = []
for x in range(a):
	string = ''
	sa = input().split(' ')
	string += sa[0]
	string += '+'
	string += sa[1]
	bad.append(string)
a = Counter(bad).most_common(1)
print(a[0][1])


n = int(input())
d = {}
s = set()
for i in range(0, n):
	x = tuple(map(int, input().split()))
	if x not in s:
		s.add(x)
		d[x] = 1
	else:
		d[x] += 1
m = max(d.values())
print(m)


t = int(input())
sum = 1
f = 0
k = 0
s = 1
(a, b) = map(int, input().split())
for i in range(1, t, 1):
	(h, m) = map(int, input().split())
	if a == h and b == m:
		sum += 1
		if sum > s:
			s = sum
	else:
		sum = 1
	a = h
	b = m
print(s)


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


x = int(input())
y = []
for i in range(x):
	y.append(input().split())
for j in y:
	for k in j:
		k = int(k)
k = 0
max = 0
for p in range(len(y)):
	if p + 1 < len(y) and y[p][0] == y[p + 1][0] and (y[p][1] == y[p + 1][1]):
		k = k + 1
	else:
		if max < k:
			max = k
		k = 0
print(max + 1)


n = int(input())
count = 1
maxx = -float('inf')
(h, m) = map(int, input().split())
prev = (h, m)
for _ in range(n - 1):
	(h, m) = map(int, input().split())
	if (h, m) == prev:
		count += 1
	else:
		count = 1
	maxx = max(maxx, count)
	prev = (h, m)
maxx = max(maxx, count)
print(maxx)


def main():
	n = int(input())
	s = {}
	m = 0
	for i in range(n):
		(a, b) = map(int, input().split(' '))
		if (a, b) in s:
			s[a, b] += 1
		else:
			s[a, b] = 1
		m = max(m, s[a, b])
	return m
print(main())


t = {}
for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = a * 60 + b
	t[c] = t.get(c, 0) + 1
print(max(t.values()))


n = int(input())
customerTimes = [input() for i in range(n)]
maxCashiers = 1
currentCashiers = 1
for index in range(1, len(customerTimes)):
	if customerTimes[index] == customerTimes[index - 1]:
		currentCashiers += 1
		if currentCashiers > maxCashiers:
			maxCashiers = currentCashiers
	else:
		currentCashiers = 1
print(maxCashiers)


n = int(input())
answ = 1
kass = 1
time = []
for i in range(n):
	time.append(input())
time.append('none')
for i in range(n):
	if time[i] == time[i + 1]:
		kass += 1
	else:
		if kass > answ:
			answ = kass
		kass = 1
print(answ)


n = int(input())
a = 0
b = 0
k = 0
ma = 0
for i in range(n):
	l = input().split()
	if a == l[0] and b == l[1]:
		k = k + 1
	else:
		if ma < k:
			ma = k
		k = 0
	a = l[0]
	b = l[1]
if ma < k:
	ma = k
print(ma + 1)


import math
from decimal import Decimal

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 eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

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)
n = int(input())
d = {}
for i in range(n):
	s = input()
	d[s] = d.get(s, 0) + 1
print(max(d.values()))


import sys
from math import log, sqrt, factorial

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())
t = ii()
l = []
while t:
	t -= 1
	(x, y) = mi()
	l.append(x * 60 + y)
hash = [0] * 100000
for i in range(len(l)):
	if hash[l[i]] == 0:
		hash[l[i]] = 1
	else:
		hash[l[i]] += 1
print(max(hash))


n = int(input())
(prev_x, prev_y) = map(int, input().split())
count = [1] * n
max_count = 0
flag = 0
for i in range(n - 1):
	(x1, y1) = map(int, input().split())
	if prev_x is x1 and prev_y is y1:
		count[flag] += 1
	else:
		flag += 1
	prev_x = x1
	prev_y = y1
print(max(count))


from collections import Counter
n = int(input())
l = []
for i in range(n):
	(h, m) = map(int, input().split())
	l.append(h * 60 + m)
d = Counter(l)
print(d.most_common(1)[0][1])


def Sol(time_ar, n):
	free = 1
	i = 1
	while i < n:
		same_time = 1
		diff = time_ar[i] - time_ar[i - 1]
		if diff == 0:
			same_time = 2
			j = i + 1
			while j < n:
				temp = time_ar[j] - time_ar[i]
				if temp == 0:
					same_time += 1
					j += 1
					i += 1
				else:
					i = j
					break
		if same_time > free:
			needed = same_time - free
			free += needed
		i += 1
	print(free)
	return
n = int(input())
arr = []
for i in range(n):
	time = list(map(int, input().split()))
	time = time[0] + time[1] / 60
	arr.append(time)
Sol(arr, n)


dict = {}
for x in range(int(input())):
	i = input()
	dict[i] = dict.get(i, 0) + 1
print(max(dict.values()))


n = int(input())
lis = []
for i in range(n):
	(h, m) = map(int, input().split())
	lis.append([h, m])
ans_lis = []
ph = -1
pm = -1
res = 1
ans = 0
for i in range(n):
	if ph == lis[i][0] and pm == lis[i][1]:
		res += 1
	else:
		res = 1
	ans = max(res, ans)
	ph = lis[i][0]
	pm = lis[i][1]
print(ans)


n = int(input())
t = [0] * 1440
for i in range(n):
	(h, m) = map(int, input().split())
	t[h * 60 + m] += 1
print(max(t))


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


n = int(input())
p = {}
for i in range(n):
	(h1, m1) = map(int, input().split())
	b = str(h1) + ':' + str(m1)
	if b in p:
		p[b] += 1
	else:
		p[b] = 1
print(max(p.values()))


import sys
import math
import collections
import heapq
import decimal
n = int(input())
c = 1
prev = input()
if n == 1:
	print(1)
else:
	c1 = 1
	for i in range(1, n):
		s = input()
		if s == prev:
			c1 += 1
		else:
			c = max(c, c1)
			c1 = 1
		prev = s
	c = max(c, c1)
	print(c)


a = int(input())
h = []
m = []
p = 0
t = []
c = ''
for i in range(a):
	l = input().split()
	s = l[0] + ' ' + l[1]
	if c == s:
		p = p + 1
		if i == a - 1:
			t.append(p)
	else:
		t.append(p)
		p = 0
		c = s
r = max(t)
print(r + 1)


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


t = int(input())
c = 1
o = 1
(a0, b0) = map(int, input().split())
for i in range(t - 1):
	(a, b) = map(int, input().split())
	if a == a0 and b == b0:
		o += 1
		if o > c:
			c = o
	else:
		o = 1
	a0 = a
	b0 = b
print(c)


n = int(input())
d = {}
for _ in range(n):
	(h, m) = map(int, input().split())
	s = str(h) + str(':') + str(m)
	if s not in d:
		d[s] = 1
	else:
		d[s] += 1
a = d.values()
mv = max(a)
print(mv)


k = int(input())
(l, a) = ([], [])
for i in range(k):
	(m, n) = map(int, input().split())
	l.append([m, n])
for j in range(k - 1):
	if l[j + 1] == l[j]:
		a.append('1')
	else:
		a.append('0')
a = ''.join(a)
a = a.split('0')
print(len(max(a)) + 1)


inp = input().split()
n = int(inp[0])
numb = 0
map = {}
for i in range(0, n):
	inp = input().split()
	numb = int(inp[0]) * 60 + int(inp[1])
	if map.get(numb) == None:
		map[numb] = 1
	else:
		map[numb] += 1
ans = 0
for i in map:
	ans = max(ans, map[i])
print(ans)


from statistics import mode
n = int(input())
arr = []
for i in range(n):
	(a, b) = map(int, input().split())
	arr.append((a, b))
print(arr.count(mode(arr)))


n = int(input())
prev = [-1, -1]
c = 1
ans = 0
for i in range(n):
	(a, b) = map(int, input().split())
	x = [a, b]
	if prev == x:
		c += 1
	else:
		(prev[0], prev[1]) = (a, b)
		ans = max(c, ans)
		c = 1
ans = max(c, ans)
print(ans)


n = int(input())
(prev_x, prev_y) = map(int, input().split())
count = 1
ans = 1
for i in range(n - 1):
	(x1, y1) = map(int, input().split())
	if prev_x is x1 and prev_y is y1:
		count += 1
	else:
		count = 1
	prev_x = x1
	prev_y = y1
	ans = max(ans, count)
print(ans)


n = int(input())
hour = []
minute = []
for i in range(n):
	(h, m) = map(int, input().split())
	hour.append(h)
	minute.append(m)
ch = 0
o = 0
for i in range(len(minute) - 1):
	if minute[i] == minute[i + 1]:
		ch += 1
		if ch > o:
			o = ch
	else:
		ch = 0
print(1 + o)


n = int(input())
a = []
for i in range(n):
	b = list(map(int, input().split()))
	a.append(b)
k = 1
l = 1
for i in range(n - 1):
	if a[i] == a[i + 1]:
		l += 1
		k = max(k, l)
	else:
		l = 1
print(k)


last_h = -1
last_m = -1
count = 1
maxCount = -1
t = int(input())
while t:
	(h, m) = map(int, input().split())
	if h == last_h and m == last_m:
		count += 1
	else:
		maxCount = max(count, maxCount)
		count = 1
	(last_h, last_m) = (h, m)
	t -= 1
print(max(maxCount, count))


t = int(input())
l = [0] * 1450
for i in range(t):
	(a, b) = map(int, input().split())
	l[60 * a + b] += 1
print(max(l))


n = int(input())
a = {}
for i in range(n):
	x = input().split(' ')
	s = int(x[0]) * 60 + int(x[1])
	if s not in a:
		a[s] = 0
	a[s] += 1
max = 1
for i in a:
	n = a[i]
	if n > max:
		max = n
print(max)


n = int(input())
same = 1
min_cashier = 1
for i in range(0, n):
	(hr, minutes) = input().split()
	hr = int(hr)
	minutes = int(minutes)
	exact_time = hr * 60 + minutes
	if i == 0:
		prev = exact_time
	elif prev == exact_time:
		same += 1
	else:
		temp_cashier = same
		same = 1
		prev = exact_time
		if temp_cashier > min_cashier:
			min_cashier = temp_cashier
if same > 1:
	if same > min_cashier:
		min_cashier = same
print(min_cashier)


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


n = int(input())
(c, t) = (1, 1)
temp = []
for _ in range(n):
	if not temp:
		temp.append(list(map(int, input().split())))
	else:
		k = list(map(int, input().split()))
		if k == temp[-1]:
			t += 1
			if _ == n - 1:
				c = max(c, t)
		else:
			c = max(c, t)
			t = 1
		temp.append(k)
print(c)


from collections import Counter
n = int(input())
a = [tuple(map(int, input().split())) for i in range(n)]
a = Counter(a)
print(max(a.values()))


n = int(input())
(dic, res) = ({}, 0)
for i in range(n):
	(x, y) = map(int, input().split(' '))
	if (x, y) in dic:
		dic[x, y] += 1
	else:
		dic[x, y] = 1
	res = max(res, dic[x, y])
print(res)


(cur, count) = (1, 1)
(hPrev, mPrev) = (-1, -1)
for i in range(int(input())):
	(h, m) = [int(i) for i in input().split()]
	if h == hPrev and m == mPrev:
		cur += 1
		if cur > count:
			count = cur
	else:
		cur = 1
	(hPrev, mPrev) = (h, m)
print(count)


n = int(input())
a = []
for i in range(n):
	(h, m) = map(int, input().split())
	t = h * 60 + m
	a.append(t)
a.sort()
c = 1
r = 0
for i in range(1, n):
	if a[i] == a[i - 1]:
		c += 1
	else:
		r = max(r, c)
		c = 1
r = max(r, c)
print(r)


from sys import stdin, stdout
input = stdin.readline
n = int(input())
cur = ans = 0
for i in range(n):
	inp = input()
	if i == 0:
		pre = inp
	if inp == pre:
		cur += 1
	else:
		pre = inp
		ans = max(ans, cur)
		cur = 1
stdout.write(str(max(ans, cur)))


from sys import stdin
from collections import defaultdict
input = lambda : stdin.readline().strip()
max1 = 0
lst = []
for _ in range(int(input())):
	(a, b) = input().split()
	if len(lst) != 0:
		if lst[0][0] == a and lst[0][1] == b:
			lst.append([a, b])
		else:
			c = len(lst)
			if c > max1:
				max1 = c
			lst = []
			lst.append([a, b])
	else:
		lst.append([a, b])
if len(lst) > max1:
	max1 = len(lst)
print(max1)


n = int(input())
l = {}
max = 0
for i in range(n):
	(a, b) = list(input().split())
	if int(a) < 10:
		a = '0' + a
	if int(b) < 10:
		b = '0' + b
	time = a + b
	if l.get(time):
		l[time] += 1
	else:
		l[time] = 1
	if max <= l[time]:
		max = l[time]
print(max)


i = input
n = int(i())
a = 0
r = ''
k = 1
while n:
	v = i().strip()
	k = [k + 1, 1][v != r]
	r = v
	n -= 1
	a = [a, k][k > a]
print(a)


from collections import defaultdict
n = int(input())
a = []
for _ in range(n):
	a.append(tuple(map(int, input().split())))
d = defaultdict(int)
for i in a:
	d[i] += 1
mx = 0
for i in d:
	mx = max(mx, d[i])
print(mx)


n = int(input())
ct = 1
high = 1
(h_f, m_f) = map(int, input().split())
for i in range(n - 1):
	(h_e, m_e) = map(int, input().split())
	if h_f == h_e and m_f == m_e:
		ct += 1
	else:
		ct = 1
	(h_f, m_f) = (h_e, m_e)
	if ct > high:
		high = ct
print(high)


d = {}
for i in range(int(input())):
	s = input()
	d[s] = d.get(s, 0) + 1
print(max(d.values()))


import collections
import bisect
mod = 1000000007
pi = 3.141592653589
IS = float('inf')
xy = [(1, 0), (-1, 0), (0, 1), (0, -1)]
bs = [(-1, -1), (-1, 1), (1, 1), (1, -1)]

def niten(a, b):
	return abs(a - b) if a >= 0 and b >= 0 else a + abs(b) if a >= 0 else abs(a) + b if b >= 0 else abs(abs(a) - abs(b))

def fib(n):
	return [(seq.append(seq[i - 2] + seq[i - 1]), seq[i - 2])[1] for seq in [[0, 1]] for i in range(2, n)]

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

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

def eucl(x1, y1, x2, y2):
	return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5

def choco(xa, ya, xb, yb, xc, yc, xd, yd):
	return 1 if abs((yb - ya) * (yd - yc) + (xb - xa) * (xd - xc)) < 1e-10 else 0

def pscl(num, l=[1]):
	for i in range(num):
		l = map(lambda x, y: x + y, [0] + l, l + [0])
	return l
n = int(input())
d = collections.defaultdict(int)
ans = chk = 1
for i in range(n):
	k = input()
	d[k] += 1
	ans = max(ans, d[k])
print(ans)


n = int(input())
(m, l) = (0, 0)
t = ['0', '0']
for i in range(n):
	s = input().split()
	if s == t:
		l += 1
	else:
		t = s
		l = 1
	if l > m:
		m = l
print(m)


dp = [[0 for i in range(60)] for j in range(25)]
t = int(input())
for _ in range(t):
	(x, y) = [int(i) for i in input().split()]
	dp[x][y] += 1
m = 0
for i in range(25):
	m = max(m, max(dp[i]))
print(m)


n = int(input())
dic = {}
for _ in range(n):
	tup = tuple(map(int, input().split()))
	if tup in dic:
		dic[tup] += 1
	else:
		dic[tup] = 1
print(max(dic.values()))


cantidadClientes = int(input())
horaAnterior = ''
contador = 1
contadorActual = 1
for indice in range(cantidadClientes):
	cliente = input()
	if cliente == horaAnterior:
		contadorActual += 1
	else:
		horaAnterior = cliente
		if contadorActual > contador:
			contador = contadorActual
		contadorActual = 1
if contadorActual > contador:
	contador = contadorActual
print(contador)


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


n = int(input())
x = []
for _ in range(n):
	x.append(input())
from collections import Counter as cc
y = cc(x).most_common(1)
print(y[0][1])


n = int(input())
l = {}
min = 1
for i in range(n):
	p = input()
	if p in l:
		l[p] += 1
	else:
		l[p] = 1
key_max = max(l.keys(), key=lambda k: l[k])
print(l[key_max])


n = int(input())
hours = []
minutes = []
for i in range(n):
	(h, m) = map(int, input().split())
	hours.append(h)
	minutes.append(m)
cashes = 1
x = cashes
for i in range(n - 1):
	if hours[i] == hours[i + 1] and minutes[i] == minutes[i + 1]:
		cashes += 1
	else:
		if cashes > x:
			x = cashes
		cashes = 1
if cashes > x:
	x = cashes
print(x)


n = int(input())
prev = (-1, -1)
curr = 0
maxoverlaps = 0
for _ in range(n):
	(h, m) = [int(x) for x in input().split()]
	if (h, m) == prev:
		curr += 1
		maxoverlaps = max(maxoverlaps, curr)
	else:
		curr = 1
	prev = (h, m)
maxoverlaps = max(maxoverlaps, curr)
print(maxoverlaps)


n = int(input())
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	time = h * 60 + m
	try:
		d[time] += 1
	except:
		d[time] = 1
print(max(d.values()))


n = int(input())
ref = 1440 * [0]
for j in range(n):
	(x, y) = [int(j) for j in input().split()]
	time = x * 60 + y
	ref[time] += 1
print(max(ref))


n = int(input())
a = []
b = []
c = []
for i in range(n):
	(aa, bb) = [int(i) for i in input().split()]
	c.append(aa * 60 + bb)
akh = c[0]
x = 1
a.append(x)
for i in range(1, n):
	if c[i] == akh:
		x = x + 1
		a.append(x)
	else:
		a.append(x)
		x = 1
	akh = c[i]
print(max(a))


n = int(input())
hour = -1
minutes = -1
cash = 1
count = 1
for i in range(n):
	a = list(map(int, input().split()))
	if a[0] == hour and a[1] == minutes:
		count += 1
		if count > cash:
			cash = count
	elif a[0] != hour or a[1] != minutes:
		count = 1
	(hour, minutes) = (a[0], a[1])
print(cash)


n = int(input())
temp = 1
q = 1
last = input().split()
for i in range(n - 1):
	(h, m) = input().split()
	if h == last[0] and m == last[1]:
		temp += 1
		if temp > q:
			q = temp
	else:
		temp = 1
	last = [h, m]
print(q)


L = [0] * (24 * 60 + 1)
n = int(input())
for k in range(n):
	(a, b) = map(int, input().split())
	L[a * 60 + b] += 1
print(max(L))


n = int(input())
(h, m) = map(int, input().split())
z = []
k = 1
if n > 1:
	for i in range(n - 1):
		(a, b) = map(int, input().split())
		if h == a and m == b:
			k += 1
		else:
			k = 1
		(h, m) = (a, b)
		z.append(k)
else:
	z = ['1']
print(max(z))


ct = [0] * 86400
maxx = 0
n = int(input())
for _ in range(n):
	(h, m) = map(int, input().split(' '))
	ct[h * 60 + m] += 1
	maxx = max(maxx, ct[h * 60 + m])
print(maxx)


n = int(input())
prev = input()
answ = 1
cyc = False
tmp = 1
for i in range(n - 1):
	curr = input()
	if curr == prev:
		cyc = True
		tmp += 1
		if tmp > answ:
			answ = tmp
	else:
		cyc = False
		tmp = 1
	prev = curr
print(answ)


t = int(input())
d = {}
f = 0
c = []
for i in range(t):
	(p, q) = input().split()
	if i == 0:
		d[p] = []
		d[p].append(q)
	elif p not in d.keys():
		d[p] = []
		d[p].append(q)
	else:
		d[p].append(q)
for i in d.keys():
	if len(d[i]) > 1:
		f = 1
		a = list(set(d[i]))
		for j in a:
			c.append(d[i].count(j))
if f == 0:
	print(1)
else:
	print(max(c))


n = int(input())
s1 = input()
m = 1
ans = 1
for f in range(1, n):
	s2 = input()
	if s2 == s1:
		m += 1
		if m > ans:
			ans = m
	else:
		m = 1
	s1 = s2
print(ans)


i = lambda : map(int, input().split())
n = int(input())
last = 'j'
c = 1
streak = 1
for i in range(n):
	t = input()
	if last == t:
		c += 1
	else:
		streak = max(c, streak)
		c = 1
	last = t
streak = max(c, streak)
print(streak)


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


n = int(input())
cus = [[0, 0] for _ in range(n)]
for i in range(n):
	cus[i] = [int(x) for x in input().split()]
cashes = 1
max_cash = 1
for i in range(1, n):
	if cus[i - 1] == cus[i]:
		cashes += 1
		max_cash = max(max_cash, cashes)
	else:
		cashes = 1
print(max_cash)


n = int(input())
last = None
(res, cnt) = (0, 0)
for _ in range(n):
	cur = input()
	if cur == last:
		cnt += 1
	else:
		cnt = 1
	res = max(res, cnt)
	last = cur
print(res)


c = 1
m = 1
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if i != 0 and (x == px and y == py):
		c += 1
		m = max(c, m)
	elif i != 0 and (x != px or y != py):
		c = 1
	px = x
	py = y
print(m)


import sys
visitors = int(sys.stdin.readline())
cashes = 1
lastServedTime = (0, 0)
served = 1
for i in range(visitors):
	inputs = sys.stdin.readline().split()
	currentServedTime = (inputs[0], inputs[1])
	if lastServedTime == currentServedTime:
		served += 1
		if served > cashes:
			cashes += 1
	else:
		served = 1
	lastServedTime = currentServedTime
print(cashes)


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')
n = int(input())
ans = 0
c = 1
(h, m) = (-1, -1)
for i in range(n):
	(x, y) = map(int, input().split())
	if x == h and y == m:
		c += 1
	else:
		c = 1
	(h, m) = (x, y)
	if c > ans:
		ans = c
print(ans)


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


from collections import Counter
t = int(input())
lst = []
lst1 = []
setlst = []
for i in range(t):
	x = input()
	lst.append(x)
cnt = Counter(lst)
setlst = list(set(lst))
a1 = len(setlst)
for j in range(a1):
	lst1.append(cnt[setlst[j]])
print(max(lst1))


__author__ = 'runekri3'
n = int(input())
cur_streak = 1
max_streak = 1
last_time = ''
for _ in range(n):
	time = input()
	if time != last_time:
		if cur_streak > max_streak:
			max_streak = cur_streak
		cur_streak = 1
		last_time = time
	else:
		cur_streak += 1
if cur_streak > max_streak:
	max_streak = cur_streak
print(max_streak)


t = int(input())
lst = []

def frequency_of_element(lst):
	dic = {}
	for item in lst:
		if item in dic:
			dic[item] += 1
		else:
			dic[item] = 1
	return dic
for i in range(t):
	lst.append(input())
fq_dic = frequency_of_element(lst)
maxi = 0
for (key, value) in fq_dic.items():
	if maxi < value:
		maxi = value
print(maxi)


n = int(input())
hsl = 1
temp = [-1, -1]
count = 0
for i in range(n):
	a = [int(x) for x in input().split()]
	if temp == a:
		count = count + 1
	else:
		hsl = max(hsl, count)
		count = 1
		temp = a
	hsl = max(hsl, count)
print(hsl)


n = int(input())
max = 1
(a, b) = input().split(' ')
counter = 1
for i in range(n - 1):
	(c, d) = input().split(' ')
	if a == c and b == d:
		counter += 1
		if counter > max:
			max = counter
	else:
		a = c
		b = d
		counter = 1
print(max)


import sys
import itertools
import math
import collections
from collections import Counter

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

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def ceil(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
n = ii()
d = dd()
for i in range(n):
	d[input()] += 1
print(max(d.values()))


import sys
n = int(sys.stdin.readline())
last = None
x = 0
max_x = 0
for i in range(n):
	line = sys.stdin.readline()
	if line == last:
		x += 1
	else:
		max_x = max(x, max_x)
		x = 1
	last = line
max_x = max(x, max_x)
print(max_x)


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 = 1
for i in range(n):
	l.append(si())
c = 1
for i in range(1, n):
	c = c + 1 if l[i - 1] == l[i] else 1
	mx = max(mx, c)
print(mx)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter

def main():
	n = int(input())
	l = []
	for _ in range(n):
		l.append(tuple(map(int, input().split())))
	cnt = Counter(l)
	print(max(cnt.values()))

def nouse0():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse1():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse2():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
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 nouse3():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse4():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse5():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
main()


n = int(input())
total = 1
maximum = 1
(h_b, m_b) = [int(i) for i in input().split()]
for i in range(1, n):
	(h_p, m_p) = [int(j) for j in input().split()]
	if h_p == h_b and m_p == m_b:
		total += 1
		maximum = max(maximum, total)
	else:
		(h_b, m_b) = (h_p, m_p)
		total = 1
print(maximum)


N = int(input())
times_d = {}
for i in range(N):
	(h, m) = map(int, input().split())
	time = h * 60 + m
	times_d[time] = times_d.get(time, 0) + 1
maxv = max(times_d.values())
print(maxv)


n = int(input())
time = []
for i in range(n):
	(h, m) = map(int, input().strip().split(' '))
	time.append(h * 60 + m)
cnt = [0] * n
cnt[0] = 1
max_cash = 1
for j in range(1, n):
	if time[j] != time[j - 1]:
		cnt[j] = 1
	else:
		cnt[j] = cnt[j - 1] + 1
		max_cash = max(cnt[j], max_cash)
print(max_cash)


n = int(input())
before = input()
ans = 1
if n != 1:
	count = 1
	for i in range(n - 1):
		after = input()
		if before == after:
			count += 1
			ans = max(ans, count)
		else:
			before = after
			count = 1
print(ans)


n = int(input())
(count, max) = (1, 0)
a = list(map(int, input().split()))
for i in range(n - 1):
	b = a
	a = list(map(int, input().split()))
	if a[0] == b[0] and a[1] == b[1]:
		count += 1
	else:
		if count > max:
			max = count
		count = 1
print(max if count < max else count)


n = int(input())
count = 1
cashes = []
(old_h, old_m) = map(int, input().split())
for customer in range(n - 1):
	(h, m) = map(int, input().split())
	if h == old_h and m == old_m:
		count += 1
	else:
		cashes.append(count)
		count = 1
	(old_h, old_m) = (h, m)
cashes.append(count)
print(max(cashes))


from collections import defaultdict
dic = defaultdict(int)
for i in range(int(input())):
	(a, b) = map(int, input().split())
	dic[60 * a + b] += 1
print(max(dic.values()))


n = int(input())
worker = 1
times = {}
for i in range(n):
	time = input()
	if time in times.keys():
		times[time] += 1
	else:
		times[time] = 1
MAX = 0
for time in times.keys():
	if times[time] > MAX:
		MAX = times[time]
print(MAX)


n = int(input())
d1 = {}
for i in range(0, n):
	(h, m) = map(int, input().split())
	if (h, m) not in d1:
		d1[h, m] = 1
	else:
		d1[h, m] += 1
maximum = max(d1, key=d1.get)
print(d1[maximum])


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	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 bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, ll, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		if ll[mid] >= val:
			ans = ll[mid]
			return binary(l, mid - 1, ll, val, ans)
		else:
			return binary(mid + 1, r, ll, val, ans)
n = int(stdin.readline())
l = []
for i in range(n):
	(a, b) = map(int, stdin.readline().split(' '))
	l1 = []
	l1.append(a)
	l1.append(b)
	l.append(l1)
c = 1
a1 = l[0][0]
a2 = l[0][1]
cashes = 0
for i in range(1, n):
	if l[i][0] == a1 and l[i][1] == a2:
		c += 1
		if c > cashes:
			cashes = c
	else:
		c = 1
		a1 = l[i][0]
		a2 = l[i][1]
if c > cashes:
	stdout.write(str(c) + '\n')
else:
	stdout.write(str(cashes) + '\n')


from collections import Counter
a = int(input())
b = []
nup = []
nip = []
nou = []
cc = []
for i in range(a):
	b.append(input())
unos = Counter(b)
unos.most_common(1)[0][0] if unos else None
cunos = unos[unos.most_common(1)[0][0]]
print(cunos)


amount = int(input())
temp = 9999
count = 1
maxcount = 1
for i in range(amount):
	(a, b) = map(int, input().split())
	if temp == 100 * a + b:
		count += 1
	else:
		maxcount = max(count, maxcount)
		count = 1
	temp = 100 * a + b
	maxcount = max(count, maxcount)
print(maxcount)


n = int(input())
answer = 1
set_p = set()
(prev_s, now_sum) = (input(), 1)
for i in range(n - 1):
	s = input()
	if s == prev_s:
		now_sum += 1
		if now_sum > answer:
			answer = now_sum
	else:
		now_sum = 1
	prev_s = s
print(answer)


n = int(input())
pr = '-1 -1'
mx = 1
l = 1
for _ in range(n):
	ct = input()
	if pr == ct:
		l += 1
		mx = max(mx, l)
	else:
		l = 1
	pr = ct
print(mx)


n = int(input())
simultaneous_clients = 1
res = 1
(h_prev, m_prev) = map(int, input().split())
for i in range(0, n - 1):
	(h, m) = map(int, input().split())
	if h_prev == h and m_prev == m:
		simultaneous_clients += 1
		if simultaneous_clients > res:
			res = simultaneous_clients
	else:
		simultaneous_clients = 1
	h_prev = h
	m_prev = m
print(res)


lst = dict()
for i in range(int(input())):
	h = input()
	lst[h] = lst.get(h, 0) + 1
mx = max(lst.values())
print(mx)


n = int(input())
maxx = 0
count = 0
h_prev = None
m_prev = None
for i in range(n):
	(h, m) = input().split(' ')
	if h == h_prev and m == m_prev:
		count += 1
	else:
		if count > maxx:
			maxx = count
		count = 1
		h_prev = h
		m_prev = m
print(max(maxx, count))


from collections import Counter
d = {}
for i in range(int(input())):
	(h, m) = map(int, input().split())
	if (h, m) in d:
		d[h, m] += 1
	else:
		d[h, m] = 1
print(max(d.values()))


n = int(input())
d = {}
for i in range(n):
	(h, m) = map(str, input().split())
	k = h + ':' + m
	if k in d:
		d[k] += 1
	else:
		d[k] = 1
ans = chk = 0
for i in d:
	ans = max(ans, d[i])
print(ans)


count_clients = int(input())
k = 0
date_dictionary = {}
for i in range(count_clients):
	incoming_time = input()
	if incoming_time in date_dictionary:
		date_dictionary[incoming_time] += 1
	else:
		date_dictionary[incoming_time] = 1
k = max(date_dictionary.values())
print(k)


visitor = dict()
for __ in range(int(input())):
	(h, m) = map(int, input().split())
	visitor[h, m] = visitor.get((h, m), 0) + 1
print(max(visitor.values()))


n = int(input())
from collections import Counter
c = Counter([])
for _ in range(n):
	hm = list(map(int, input().split()))
	(h, m) = hm
	c[h, m] += 1
print(max(c.values()))


cpt = 1
x = 1
n = int(input())
(h1, m1) = map(int, input().split())
for i in range(n - 1):
	(h, m) = map(int, input().split())
	if h < h1:
		raise Exception('no')
	elif m < m1 and h == h1:
		raise Exception('no')
	if m == m1 and h == h1:
		x += 1
	else:
		if x >= cpt:
			cpt = x
		x = 1
	m1 = m
	h1 = h
if x > cpt:
	cpt = x
print(cpt)


(a, b) = (-1, -1)
ans = 1
c = []
for i in range(int(input())):
	(h, m) = map(int, input().split())
	if h == a and m == b:
		ans += 1
	else:
		a = h
		b = m
		c.append(ans)
		ans = 1
c.append(ans)
print(max(c))


import copy
n = int(input())
a = dict()
for i in range(n):
	k = tuple(map(int, input().split()))
	if k in a.keys():
		a[k] += 1
	else:
		a[k] = 1
print(max(a.values()))


def cashier(customer):
	l = []
	lst = []
	time_tmp = 0
	count = 1
	if customer == 1:
		return count
	for value in range(customer):
		(hour, minutes) = map(int, input().split())
		time = hour * 60 + minutes
		if time == 0:
			lst.append(time)
		elif time != time_tmp:
			time_tmp = time
		else:
			time_tmp = time
			count += 1
			continue
		l.append(count)
		count = 1
	if value == customer - 1:
		l.append(count)
	count = len(lst)
	cash_box = max(max(l), count)
	return cash_box
customers = int(input())
print(cashier(customers))


from collections import Counter

def free_cash_reg():
	n = int(input().strip())
	c = Counter()
	for i in range(n):
		ip = input().strip()
		c[ip] += 1
	return c.most_common()[0][1]
print(free_cash_reg())


n = int(input())
times = {}
needed = 1
for i in range(n):
	joined = input()
	if joined in times:
		times[joined] += 1
		if times[joined] > needed:
			needed = times[joined]
	else:
		times[joined] = 1
print(needed)


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


import sys
input = sys.stdin.readline
n = int(input())
d = {}
mv = -sys.maxsize
for i in range(n):
	t = input()
	if d.get(t, False):
		d[t] += 1
	else:
		d[t] = 1
	mv = max(d[t], mv)
print(mv)


N = int(input())
dic = {}
for i in range(N):
	l = list(map(int, input().split()))
	t = (l[0], l[1])
	if t in dic:
		dic[t] += 1
	else:
		dic[t] = 1
r = list(sorted(dic.items(), key=lambda x: x[1]))
print(r[-1][1])


n = int(input())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	l.append(a + b / 60)
from collections import Counter
c = Counter(l)
print(max((c[i] for i in c)))


n = int(input()) - 1
(h, m) = input().split(' ')
(count, final_count) = (1, 1)
while n != 0:
	(h2, m2) = input().split(' ')
	if h2 == h and m2 == m:
		count += 1
		if count > final_count:
			final_count = count
	else:
		count = 1
	h = h2
	m = m2
	n -= 1
print(final_count)


import math
n = int(input())
A = []
k = 1
m = 0
for i in range(n):
	s = input()
	A.append(s)
	if i > 0:
		if A[i] == A[i - 1]:
			k += 1
		else:
			m = max(m, k)
			k = 1
m = max(m, k)
print(m)


b = {}
for i in range(int(input())):
	a = input()
	if a in b:
		b[a] += 1
	else:
		b[a] = 1
c = 0
for i in b.values():
	if i > c:
		c = i
print(c)


def min_cashes(n):
	cashes = 1
	client = 0
	previous_time = (0, 0)
	for i in range(n):
		(hour, minute) = [int(x) for x in input().split()]
		cur_time = (hour, minute)
		if previous_time == cur_time:
			client += 1
			if client > cashes:
				cashes += 1
		else:
			client = 1
		previous_time = cur_time
	return cashes

def main():
	client_num = int(input())
	if client_num <= 100000 and client_num >= 1:
		print(min_cashes(client_num))
main()


n = int(input())
A = []
for i in range(0, n):
	(a, b) = input().split()
	c = a + b
	A.append(int(c))
count = 1
Max = 1
for j in range(0, n - 1):
	if A[j + 1] == A[j]:
		count = count + 1
		if count > Max:
			Max = count
	elif A[j + 1] != A[j]:
		count = 1
print(Max)


from collections import Counter

def read_number_line():
	return [int(i) for i in input().split()]
counter = Counter()
for _ in range(int(input())):
	counter[input()] += 1
print(counter.most_common(1)[0][1])


t = int(input())
temp = 0
ans = 0
for x in range(t):
	targ = input()
	if x == 0:
		target = targ
		temp = 1
	elif target == targ:
		temp += 1
	else:
		ans = max(temp, ans)
		temp = 1
		target = targ
ans = max(temp, ans)
print(ans)


l = []
ans = [[0 for i in range(60)] for j in range(25)]
c = 0
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	ans[a][b] += 1
for i in range(0, 24):
	for j in range(0, 60):
		if ans[i][j] > c:
			c = ans[i][j]
print(c)


n = int(input())
k = ['', '']
ans = 0
chef = 0
for i in range(n):
	j = input().split()
	if j == k:
		ans += 1
	else:
		ans = 1
	chef = max(chef, ans)
	k = j
print(chef)


N = int(input())
W = 1
X = 1
Y = ''
for I in range(0, N):
	Z = input()
	if Z == Y:
		X += 1
		if X > W:
			W = X
	else:
		X = 1
	Y = Z
print(W)


n = int(input())
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	s = '{0}:{1}'.format(h, m)
	if s not in d:
		d[s] = 1
	else:
		d[s] += 1
mx = -1
for i in d:
	mx = max(d[i], mx)
print(mx)


n = int(input())
last = -1
m = 0
combo = 0
for i in range(n):
	a = [int(x) for x in input().split()]
	curr = a[1] + a[0] * 60
	if curr == last:
		combo += 1
	else:
		if combo > m:
			m = combo
		combo = 1
	last = curr
print(max([combo, m]))


n = int(input())
thisDict = {}
for i in range(0, n):
	s = input()
	thisDict[s] = thisDict.get(s, 0) + 1
print(max(thisDict.values()))


from collections import *
mat = []
for t in range(int(input())):
	(h, m) = map(int, input().split())
	mat.append([h, m])
d = defaultdict(list)
for i in mat:
	b = tuple(i)
	if b in d:
		d[b] += 1
	else:
		d[b] = 1
res = list(d.values())
print(max(res))


def main():
	(n, ans) = (int(input()), 0)
	hour = [[0 for x in range(60)] for y in range(24)]
	for i in range(n):
		(hi, mi) = map(int, input().split())
		hour[hi][mi] += 1
		if hour[hi][mi] > ans:
			ans = hour[hi][mi]
	print(ans)
main()


n = int(input())
a = -1
b = -1
mmm = 0
c = 1
while n > 0:
	n -= 1
	(h, m) = map(int, input().split())
	if h == a and b == m:
		c += 1
	else:
		c = 1
	if c > mmm:
		mmm = c
	a = h
	b = m
print(mmm)


n = int(input())
c = [[0, 0]] * n
for i in range(n):
	c[i] = list(map(int, input().split()))
v = 1
res = 1
for i in range(1, n):
	if c[i] == c[i - 1]:
		v += 1
		if v > res:
			res += 1
	else:
		v = 1
print(res)


n = int(input())
ips = {}
for _n in range(n):
	t = input()
	if t in ips:
		ips[t] += 1
	else:
		ips[t] = 1
c = 0
for t in ips:
	if ips[t] > c:
		c = ips[t]
print(c)


n = int(input())
(c, d) = (100, 100)
f = 1
g = []
for i in range(n):
	(a, b) = map(int, input().split())
	if a == c and b == d:
		f += 1
	elif f != 1:
		g.append(f)
		f = 1
	(c, d) = (a, b)
if f > 1:
	g.append(f)
if bool(g) == True:
	print(max(g))
else:
	print(1)


n = int(input())
(hour1, minute1) = map(int, input().split())
num = 1
max_num = 1
for i in range(1, n):
	x = input()
	(hour2, minute2) = map(int, x.split())
	if hour2 == hour1 and minute2 == minute1:
		num += 1
		if max_num < num:
			max_num = num
	else:
		num = 1
		hour1 = hour2
		minute1 = minute2
print(max_num)


n = int(input())
cash = {}
for i in range(n):
	key = input()
	if key in cash:
		cash[key] += 1
	else:
		cash[key] = 1
maxm = 0
for key in cash:
	if cash[key] > maxm:
		maxm = cash[key]
print(maxm)


n = int(input())
prev = input()
sol = 1
if n != 1:
	counter = 1
	for _ in range(n - 1):
		current = input()
		if prev == current:
			counter += 1
			sol = max(sol, counter)
		else:
			prev = current
			counter = 1
print(sol)


n = int(input())
(count, max_count) = (1, 1)
first = input()
for i in range(n - 1):
	next = input()
	if first == next:
		count += 1
		max_count = max(count, max_count)
	else:
		count = 1
	first = next
print(max_count)


n = int(input())
dct = dict()
for i in range(n):
	strr = input()
	dct.setdefault(strr, 0)
	dct[strr] += 1
abc = max(dct, key=dct.get)
print(dct[abc])


n = int(input())
track = dict()
for i in range(n):
	(h, m) = map(int, input().split())
	s = str(h) + '_' + str(m)
	if not s in track.keys():
		track[s] = 0
	track[s] += 1
ans = 0
for i in track.keys():
	ans = max(ans, track[i])
print(ans)


n = int(input())
count = 1
arr = []
hasil = []
for i in range(n):
	z = input()
	if z in arr:
		count += 1
	else:
		arr.append(z)
		hasil.append(count)
		count = 1
hasil.append(count)
print(max(hasil))


a = int(input())
listtime = []
count = 1
max = 1
listtime.append(input())
for i in range(a - 1):
	listtime.append(input())
	if listtime[i + 1] == listtime[i]:
		count += 1
	else:
		if max < count:
			max = count
		count = 1
if max < count:
	max = count
print(max)


def name_of_problem(n, a):
	d = [0] * 10000
	for i in range(n):
		(h, m) = a[i]
		d[h * 60 + m] += 1
	return max(d)
nn = int(input())
dd = []
for i in range(nn):
	dd.append(list(map(int, input().split())))
print(name_of_problem(nn, dd))


n = int(input())
l1 = []
for i in range(n):
	l1.append([int(x) for x in input().split()])
i = 1
p = 1
while i < n:
	cnt = 1
	while i < n and l1[i] == l1[i - 1]:
		cnt += 1
		i += 1
	p = max(p, cnt)
	i += 1
print(p)


a = int(input())
b = []
for i in range(a):
	b.append(list(map(int, input().split())))
streak = 1
cash = 1
for i in range(a - 1):
	if b[i] == b[i + 1]:
		streak += 1
		if streak > cash:
			cash = streak
	else:
		streak = 1
print(cash)


n = int(input())
m = 1
c = 1
t = '0'
for i in range(n):
	t1 = input()
	if t == t1:
		c += 1
		m = max(m, c)
	else:
		t = t1
		c = 1
print(m)


(ma, k) = (1, 1)
(ph, pm) = (-1, -1)
for i in range(int(input())):
	(h, m) = map(int, input().split())
	if h == ph and m == pm:
		k += 1
	else:
		if k > ma:
			ma = k
		k = 1
		(ph, pm) = (h, m)
if k > ma:
	ma = k
print(ma)


import sys
n = int(input())
adict = dict()
for _ in range(n):
	(h, m) = map(int, sys.stdin.readline().split())
	a = h * 100 + m
	if a in adict:
		adict[a] += 1
	else:
		adict[a] = 1
print(max([adict[a] for a in adict]))


n = int(input())
d = {}
for i in range(n):
	(x, y) = map(int, input().split())
	if (x, y) not in d:
		d[x, y] = 0
	d[x, y] = d[x, y] + 1
ans = 0
for i in d:
	if d[i] > ans:
		ans = d[i]
print(ans)


n = int(input())
maxx = -1
pre_h = -1
pre_m = -1
count = 0
for i in range(n):
	(h, m) = map(int, input().split())
	if h == pre_h and m == pre_m:
		count += 1
	else:
		count = 1
	pre_h = h
	pre_m = m
	if count > maxx:
		maxx = count
print(str(maxx))


n = int(input())
(h_l, m_l) = input().split()
(c, c_counter) = (1, [])
for i in range(n - 1):
	(h, m) = input().split()
	if h_l == h and m_l == m:
		c += 1
	else:
		(h_l, m_l) = (h, m)
		c_counter.append(c)
		c = 1
c_counter.append(c)
print(max(c_counter))


n = int(input())
(h, m) = ([], [])
for i in range(n):
	(l1, l2) = input().split()
	h.append(int(l1))
	m.append(int(l2))
r = 1
r_n = 1
k = []
for i in range(n - 1):
	if h[i] == h[i + 1] and m[i] == m[i + 1]:
		r += 1
	else:
		k.append(r)
		r = 1
k.append(r)
print(max(k))


n = int(input())
result = 0
last = (-1, -1)
c = 0
for i in range(n):
	[h, m] = list(map(int, input().split(' ')))
	c = 1 + (c if (h, m) == last else 0)
	last = (h, m)
	result = max(result, c)
print(result)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = [S() for _ in range(n)]
	d = collections.Counter(a)
	return max(d.values())
print(main())


N = int(input())
h = []
m = []
count = 1
max_count = 1
for i in range(N):
	(H, M) = map(int, input().split())
	h.append(H)
	m.append(M)
	if i == 0:
		count = 1
	elif h[i] == h[i - 1] and m[i] == m[i - 1]:
		count += 1
		if count > max_count:
			max_count = count
	elif h[i] != h[i - 1] or m[i] != m[i - 1]:
		count = 1
print(max_count)


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


n = int(input())
c = []
count = 0
s = 0
for i in range(n):
	a = list(map(int, input().split()))
	c.append(a)
	if a != c[0]:
		c.clear()
		c.append(a)
		count = 1
	else:
		count += 1
		if s < count:
			s = count
print(s)


n = int(input())
h = []
m = []
for i in range(0, n):
	time = input().split(' ')
	h.append(int(time[0]))
	m.append(int(time[1]))
maxCustomers = 0
current = 0
hour = -1
minute = -1
for e in range(0, n):
	if e is 0:
		current += 1
		maxCustomers = 1
		hour = h[e]
		minute = m[e]
	elif hour is h[e] and minute is m[e]:
		current += 1
		if current > maxCustomers:
			maxCustomers = current
	else:
		hour = h[e]
		minute = m[e]
		current = 1
print(maxCustomers)


from collections import Counter
n = int(input())
i = 0
l = []
while i < n:
	(h, m) = [int(x) for x in input().split(' ')]
	l.append(h * 60 + m)
	i += 1
print(Counter(l).most_common(1)[0][1])


n = int(input())
maxa = 0
cnt = [[0] * 60 for i in range(0, 24)]
for i in range(0, n):
	(h, m) = map(int, input().split())
	cnt[h][m] = 1 + cnt[h][m]
for i in range(0, 24):
	t = max(cnt[i])
	if t > maxa:
		maxa = t
print(maxa)


n = int(input())
c = {}
for i in range(n):
	k = input()
	c[k] = c.get(k, 0) + 1
print(max(list(c.values())))


from sys import stdin, stdout

def solve():
	n = int(stdin.readline().strip())
	li = [0] * 60 * 24
	maxi = 0
	for i in range(n):
		(hh, mm) = map(int, stdin.readline().split())
		li[hh * 60 + mm] += 1
	print(max(li))
	pass
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip()) if LOCAL_TEST else 1
t = 1
while t <= tcs:
	solve()
	t += 1


val = 0
c = 0
prev = ''
for i in range(int(input())):
	cur = input()
	if cur == prev:
		c += 1
	else:
		c = 1
	if c > val:
		val = c
	prev = cur
print(val)


table = {}
n = int(input())
x = []
for i in range(n):
	a = input()
	x.append(a)
for a in x:
	if a in table:
		table[a] += 1
	else:
		table[a] = 1
maxV = 0
for a in table:
	if table[a] > maxV:
		maxV = table[a]
print(maxV)


n = int(input())
l = []
d = []
if n == 1:
	print(1)
else:
	for i in range(n):
		(h, m) = [int(i) for i in input().split()]
		l.append((h, m))
	c = l[0]
	s = 1
	for i in range(1, n):
		if l[i] == c:
			s += 1
			if i == n - 1:
				d.append(s)
		else:
			c = l[i]
			d.append(s)
			s = 1
	print(max(d))


a = -2
b = -2
k = 1
l = 1
for t in range(int(input())):
	(h, m) = [int(i) for i in input().split()]
	if a == h and b == m:
		l += 1
	else:
		if k < l:
			k = l
		l = 1
	a = h
	b = m
if k < l:
	k = l
print(k)


n = int(input())
dic = {}
mx = -1
for _ in range(n):
	(h, m) = list(map(int, input().split()))
	if dic.get((h, m), 0) == 0:
		dic[h, m] = 1
	else:
		dic[h, m] += 1
	if mx == -1:
		mx = dic[h, m]
	else:
		mx = max(mx, dic[h, m])
print(mx)


n = int(input())
maxi = []
(a, b) = input().split()
counter = 1
for i in range(1, n):
	(x, y) = input().split()
	if x == a and y == b:
		counter += 1
	else:
		maxi.append(counter)
		counter = 1
	a = x
	b = y
	if i == n - 1:
		maxi.append(counter)
if n == 1:
	maxi.append(1)
print(max(maxi))


(t, q) = (int(input()), {})
for i in range(t):
	k = input()
	if k not in q:
		q[k] = 1
	else:
		q[k] += 1
print(q[max(q, key=q.get)])


n = int(input())
count = 0
kassa = 1
f = []
for i in range(n):
	(h, m) = map(int, input().split())
	h = h * 60 + m
	f.append(h)
for i in range(1, n):
	if f[i] != f[i - 1]:
		count = kassa
		count -= 1
	elif count > 0:
		count -= 1
	else:
		kassa += 1
print(kassa)


n = int(input())
total = 24 * 60
arr = [0 for i in range(total + 1)]
for i in range(n):
	iarr = list(map(int, input().split()))
	h = iarr[0]
	m = iarr[1]
	j = (h * 60 + m) % total
	arr[j] += 1
print(max(arr))


n = int(input())
m_best = 1
m = 1
prev = None
for i in range(n):
	inp = input()
	if inp == prev:
		m += 1
	else:
		m_best = max(m, m_best)
		m = 1
		prev = inp
m_best = max(m, m_best)
print(m_best)


n = int(input())
mas = {}
for i in range(n):
	a = input()
	if mas.get(a):
		mas[a] += 1
	else:
		mas[a] = 1
print(max(mas.values()))


t = int(input())
times = []
m_c = 0
last = '-1'
count = 1
while t:
	(n, k) = input().split(' ')
	time = n + k
	if time == last:
		count = count + 1
	else:
		if count > m_c:
			m_c = count
		count = 1
	last = time
	t -= 1
print(max(m_c, count))


a = ''
b = 1
c = 1
for i in range(int(input())):
	x = [int(i) for i in input().split()]
	if x != a:
		a = x
		if b > c:
			c = b
		b = 1
	else:
		b += 1
		if b > c:
			c = b
print(c)


n = int(input())
max = 0
count = 0
(x, y) = input().split()
for i in range(n - 1):
	(x1, y1) = input().split()
	if x == x1 and y == y1:
		count += 1
		if count > max:
			max = count
	else:
		count = 0
	x = x1
	y = y1
print(max + 1)


def serve(arr):
	ans = 1
	for i in arr:
		if len(arr[i]) == 1:
			continue
		tmp = 1
		for j in range(1, len(arr[i])):
			if arr[i][j] == arr[i][j - 1]:
				tmp += 1
			else:
				ans = max(tmp, ans)
				tmp = 1
		ans = max(tmp, ans)
	return ans
n = int(input())
arr = {}
for i in range(n):
	val = list(map(int, input().rstrip().split()))
	if val[0] in arr:
		arr[val[0]].append(val[1])
	else:
		arr[val[0]] = [val[1]]
print(serve(arr))


n = int(input())
a = {}
for x in range(n):
	lst = [int(i) for i in input().split()]
	temp = lst[0] * 100 + lst[1]
	if temp not in a:
		a[temp] = 1
	else:
		a[temp] += 1
maxx = 0
for x in a.values():
	if x > maxx:
		maxx = x
print(maxx)


h = -1
m = -1
ans = 0
otv = [1]
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if h == a and m == b:
		ans += 1
	elif ans != 0:
		otv.append(ans + 1)
		ans = 0
	h = a
	m = b
	otv.append(ans + 1)
print(max(otv))


n = int(input())
d = {}
while n > 0:
	(s, s1) = map(str, input().split())
	s = s + '0' + s1
	d[s] = d.get(s, 0) + 1
	n -= 1
print(max(d.values()))


n = int(input())
(m, count) = (0, 1)
last = ''
for _ in range(n):
	i = input()
	if i == last:
		count += 1
		m = max(m, count)
	else:
		m = max(m, count)
		last = i
		count = 1
print(m)


n = int(input())
times = {}
max_count = 1
while n > 0:
	(hour, minutes) = map(int, input().split())
	index_dic = str(hour) + '_' + str(minutes)
	if index_dic in times:
		times[index_dic] += 1
		if max_count < times[index_dic]:
			max_count = times[index_dic]
	else:
		times[index_dic] = 1
	n -= 1
print(max_count)


ans = 1
count = 1
a = b = -1
for z in range(int(input())):
	(h, m) = map(int, input().split())
	if h == a and m == b:
		count += 1
		ans = max(ans, count)
	else:
		count = 1
	(a, b) = (h, m)
print(ans)


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


d = dict()
ans = 1
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if (x, y) in d:
		d[x, y] += 1
		ans = max(ans, d[x, y])
	else:
		d[x, y] = 1
print(ans)


n = int(input())
g = input()
temp = 1
count = 1
for i in range(1, n):
	h = input()
	if g == h:
		temp += 1
	else:
		g = h
		if temp > count:
			count = temp
		temp = 1
if temp > count:
	count = temp
print(count)


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


s = set()
n = int(input())
ans = 1
temp = 1
for i in range(n):
	q = [int(x) for x in input().split()]
	if tuple(q) in s:
		temp += 1
	else:
		temp = 1
		s.add(tuple(q))
	ans = max(ans, temp)
print(ans)


from __future__ import division, print_function
import math
import os
import sys
from fractions import *
from sys import *
from decimal import *
from io import BytesIO, IOBase
from itertools import *
from collections import *
M = 10 ** 9 + 7
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

def inp():
	return sys.stdin.readline().rstrip('\r\n')

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 fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def sumofdigits(n):
	n = str(n)
	s1 = 0
	for i in n:
		s1 += int(i)
	return s1

def perfect_square(n):
	s = math.sqrt(n)
	if s == int(s):
		return True
	return False

def roman_number(x):
	if x > 15999:
		return
	value = [5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
	symbol = ['F', 'MF', 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
	roman = ''
	i = 0
	while x > 0:
		div = x // value[i]
		x = x % value[i]
		while div:
			roman += symbol[i]
			div -= 1
		i += 1
	return roman

def soretd(s):
	for i in range(1, len(s)):
		if s[i - 1] > s[i]:
			return False
	return True

def countRhombi(h, w):
	ct = 0
	for i in range(2, h + 1, 2):
		for j in range(2, w + 1, 2):
			ct += (h - i + 1) * (w - j + 1)
	return ct

def countrhombi2(h, w):
	return h * h // 4 * (w * w // 4)

def binpow(a, b):
	if b == 0:
		return 1
	else:
		res = binpow(a, b // 2)
	if b % 2 != 0:
		return res * res * a
	else:
		return res * res

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

def coprime_to_n(n):
	result = n
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			result -= result // i
		i += 1
	if n > 1:
		result -= result // n
	return result

def prime(x):
	if x == 1:
		return False
	else:
		for i in range(2, int(math.sqrt(x)) + 1):
			if x % i == 0:
				return False
		else:
			return True

def luckynumwithequalnumberoffourandseven(x, n, a):
	if x >= n and str(x).count('4') == str(x).count('7'):
		a.append(x)
	elif x < 1000000000000.0:
		luckynumwithequalnumberoffourandseven(x * 10 + 4, n, a)
		luckynumwithequalnumberoffourandseven(x * 10 + 7, n, a)
	return a

def luckynum(x, l, r, a):
	if x >= l and x <= r:
		a.append(x)
	if x > r:
		a.append(x)
		return a
	if x < 10000000000.0:
		luckynum(x * 10 + 4, l, r, a)
		luckynum(x * 10 + 7, l, r, a)
	return a

def luckynuber(x, n, a):
	p = set(str(x))
	if len(p) <= 2:
		a.append(x)
	if x < n:
		luckynuber(x + 1, n, a)
	return a

def interact(type, x):
	if type == 'r':
		inp = input()
		return inp.strip()
	else:
		print(x, flush=True)

def findTrailingZeros(n):
	count = 0
	while n >= 5:
		n //= 5
		count += n
	return count

def mergeSort(arr):
	if len(arr) > 1:
		mid = len(arr) // 2
		L = arr[:mid]
		R = arr[mid:]
		mergeSort(L)
		mergeSort(R)
		i = j = k = 0
		while i < len(L) and j < len(R):
			if L[i] < R[j]:
				arr[k] = L[i]
				i += 1
			else:
				arr[k] = R[j]
				j += 1
			k += 1
		while i < len(L):
			arr[k] = L[i]
			i += 1
			k += 1
		while j < len(R):
			arr[k] = R[j]
			j += 1
			k += 1
res = set()

def solven(p, l, a, b, n):
	if p > n or l > 10:
		return
	if p > 0:
		res.add(p)
	solven(p * 10 + a, l + 1, a, b, n)
	solven(p * 10 + b, l + 1, a, b, n)

def subsetsUtil(A, subset, index, d):
	print(*subset)
	s = sum(subset)
	d.append(s)
	for i in range(index, len(A)):
		subset.append(A[i])
		subsetsUtil(A, subset, i + 1, d)
		subset.pop(-1)
	return d

def subsetSums(arr, l, r, d, sum=0):
	if l > r:
		d.append(sum)
		return
	subsetSums(arr, l + 1, r, d, sum + arr[l])
	subsetSums(arr, l + 1, r, d, sum)
	return d

def print_factors(x):
	factors = []
	for i in range(1, x + 1):
		if x % i == 0:
			factors.append(i)
	return factors

def calc(X, d, ans, D):
	if len(X) == 0:
		return
	i = X.index(max(X))
	ans[D[max(X)]] = d
	Y = X[:i]
	Z = X[i + 1:]
	calc(Y, d + 1, ans, D)
	calc(Z, d + 1, ans, D)

def factorization(n, l):
	c = n
	if prime(n) == True:
		l.append(n)
		return l
	for i in range(2, c):
		if n == 1:
			break
		while n % i == 0:
			l.append(i)
			n = n // i
	return l

def good(b):
	l = []
	i = 0
	while len(b) != 0:
		if b[i] < b[len(b) - 1 - i]:
			l.append(b[i])
			b.remove(b[i])
		else:
			l.append(b[len(b) - 1 - i])
			b.remove(b[len(b) - 1 - i])
	if l == sorted(l):
		return True
	return False

def generate(st, s):
	if len(s) == 0:
		return
	if s not in st:
		st.add(s)
		for i in range(len(s)):
			t = list(s).copy()
			t.remove(s[i])
			t = ''.join(t)
			generate(st, t)
	return

def largestincreasingsubsequence(A):
	l = [1] * len(A)
	sub = []
	for i in range(1, len(l)):
		for k in range(i):
			if A[k] < A[i]:
				sub.append(l[k])
		l[i] = 1 + max(sub, default=0)
	return max(l, default=0)

def findOR(nums, N):
	prefix_sum = 0
	result = 0
	for i in range(N):
		result |= nums[i]
		prefix_sum += nums[i]
		result |= prefix_sum
	return result

def OR(a, n):
	ans = a[0]
	for i in range(1, n):
		ans |= a[i]
	return ans

def main():
	n = inpu()
	l = []
	for i in range(n):
		(h, m) = sep()
		q = h * 60 + m
		l.append(q)
	cnt = 1
	p = -10 ** 9
	max1 = 0
	l.sort()
	for i in range(len(l)):
		if l[i] == p:
			cnt += 1
		else:
			if cnt > max1:
				max1 = cnt
			p = l[i]
			cnt = 1
	if cnt > max1:
		max1 = cnt
	print(max1)
main()


test_cases = int(input())
customer_data = []
while test_cases > 0:
	customer_data.append(list(map(int, input().split())))
	test_cases -= 1
customer_data.sort()
customer_data.append([-1, -1])
cashier = 1
currCashier = 1
for i in range(0, len(customer_data) - 1):
	if customer_data[i] == customer_data[i + 1]:
		currCashier += 1
	else:
		cashier = max(cashier, currCashier)
		currCashier = 1
print(cashier)


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


a = int(input())
d = -1
e = -1
count = 0
q = [0]
for i in range(a):
	(b, c) = map(int, input().split())
	if b == d and c == e:
		count += 1
	else:
		q = q + [count]
		count = 0
	d = b
	e = c
q = q + [count]
print(max(q) + 1)


n = int(input())
prev = [int(x) for x in input().split()]
count = 1
m = 1
for i in range(n - 1):
	current = [int(x) for x in input().split()]
	if current == prev:
		count += 1
	else:
		m = max(count, m)
		count = 1
		prev = current.copy()
m = max(count, m)
print(m)


n = int(input())
a = []
kolvo = 1
l = 1
for i in range(n):
	b = list(map(int, input().split()))
	a.append(b)
for i in range(n - 1):
	while a[i] == a[i + 1]:
		l += 1
		while l > kolvo:
			kolvo += 1
		break
	else:
		l = 1
		if l > kolvo:
			kolvo += 1
print(kolvo)


from collections import Counter

def main():
	n = int(input())
	times = []
	for _ in range(n):
		(h, m) = map(int, input().split())
		times.append((h, m))
	cnt = Counter(times)
	print(max(cnt.values()))
main()


def solve(arr, n):
	d = {}
	max_count = 0
	for i in arr:
		if not d.get(f'{i[0]}:{i[1]}'):
			d[f'{i[0]}:{i[1]}'] = 0
		d[f'{i[0]}:{i[1]}'] += 1
	for i in d:
		if d[i] > max_count:
			max_count = d[i]
	return max(1, max_count)

def main():
	n = int(input())
	arr = []
	for _ in range(n):
		arr.append(list(map(int, list(input().split(' ')))))
	print(solve(arr, n))
main()


n = int(input())
z = []
ct = 0
b = []
for i in range(n):
	z += [list(map(int, input().split()))]
for i in range(n - 1):
	if z[i][0] == z[i + 1][0] and z[i][1] == z[i + 1][1]:
		ct = ct + 1
	else:
		if ct != 0:
			b += [ct]
		ct = 0
b += [ct]
if b == []:
	print('1')
else:
	print(max(b) + 1)


n = int(input())
times = {}
for i in range(n):
	(a, b) = input().split()
	if (a, b) not in times:
		times[a, b] = 1
	else:
		times[a, b] += 1
cash = times.values()
print(max(cash))


n = int(input())
s = []
l = 0
count = 1
for i in range(n):
	h = list(map(int, input().split()))
	if s == h:
		count += 1
	elif s != h:
		count = 1
	if l < count:
		l = count
	s = h
print(l)


x = {}
for i in range(int(input())):
	z = input()
	if z in x.keys():
		x[z] += 1
	else:
		x[z] = 1
print(max(x.values()))


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


n = int(input())
a = sorted([list(map(int, input().split())) for _ in range(n)])
(r, mx) = (1, 1)
for i in range(1, n):
	r = 1 if a[i] != a[i - 1] else r + 1
	mx = max(r, mx)
print(mx)


n = int(input())
prev = list(map(int, input().split()))
k = 1
maxK = 0
for i in range(1, n):
	cur = list(map(int, input().split()))
	if cur == prev:
		k += 1
	else:
		maxK = max(maxK, k)
		k = 1
	prev = cur
maxK = max(maxK, k)
print(maxK)


from sys import stdin, stdout
import collections
n = int(input())
AllInp = stdin.readlines()
A = []
for Inp in AllInp:
	(h, m) = map(str, Inp.split())
	A.append(h + '.' + m)
D = collections.Counter(A)
stdout.write(str(max(D.values())))


n = int(input())
res = 0
d = dict()
for i in range(n):
	(h, m) = [int(x) for x in input().split()]
	t = h * 60 + m
	if t in d:
		d[t] += 1
	else:
		d[t] = 1
	res = max(res, d[t])
print(res)


a = int(input())
hoko = ''
mat = []
z = 0
r = set()
d = {}
for i in range(a):
	s = input().strip()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
for j in d:
	if d[j] > z:
		z = d[j]
print(z)


(n, d) = (int(input()), dict())
for _ in range(n):
	s = input()
	d[s] = d.get(s, 0) + 1
print(max(d.values()))


n = int(input())
lst = []
for i in range(n):
	a = tuple(map(int, input().split()))
	lst.append(a)
lst.sort()
out = 1
count = 1
for i in range(1, n):
	if lst[i] == lst[i - 1]:
		count += 1
	else:
		count = 1
	if out < count:
		out = count
print(out)


n = int(input())
ls = []
cnt = 0
f_mx = 0
for i in range(n):
	ls1 = list(map(str, input().split()))
	if ls1[0] == '0':
		ls.append(ls1[1])
	else:
		ls.append(ls1[0] + ls1[1])
	if i > 0:
		if ls[i] == ls[i - 1]:
			cnt = cnt + 1
			flag = 0
		else:
			flag = 1
		c_mx = cnt
		if c_mx > f_mx:
			f_mx = c_mx
		if flag == 1:
			cnt = 0
print(f_mx + 1)


from collections import defaultdict
n = int(input())
d = defaultdict(int)
mincash = 1
for i in range(n):
	(a, b) = input().strip().split(' ')
	d[a, b] += 1
	mincash = max(mincash, d[a, b])
print(mincash)


n = int(input())
cont = 1
garcons = 1
for i in range(n):
	if i == 0:
		(h1, m1) = [int(x) for x in input().split()]
	else:
		(h2, m2) = [int(x) for x in input().split()]
		if h1 == h2 and m1 == m2:
			cont += 1
			if cont > garcons:
				garcons = cont
		else:
			cont = 1
		(h1, m1) = (h2, m2)
print(garcons)


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


try:
	n = int(input())
	p = []
	for i in range(n):
		(h, m) = map(int, input().split())
		p.append([h, m])
	p = sorted(p)
	c = 1
	maxi = 0
	for i in range(len(p) - 1):
		if p[i] == p[i + 1]:
			c += 1
		else:
			maxi = max(maxi, c)
			c = 1
	maxi = max(maxi, c)
	print(maxi)
except:
	pass


n = int(input())
p_h = -1
p_m = -1
m_c = 0
c = 0
for _ in range(n):
	(h, m) = map(int, input().split())
	if h == p_h and m == p_m:
		c += 1
	else:
		c = 1
	if c > m_c:
		m_c = c
	(p_h, p_m) = (h, m)
print(m_c)


from collections import Counter
n = int(input())
count = 1
lis = []
for i in range(n):
	l = list(map(int, input().split()))
	l = tuple(l)
	lis.append(l)
c = Counter(lis)
k = c.most_common(1)
print(k[0][1])


t = int(input())
(h, m) = map(int, input().split())
s = []
n = 1
l = 0
k = 1
i = 1
while i < t:
	(a, b) = map(int, input().split())
	if a == h and b == m:
		k += 1
		n = max(n, k)
	else:
		k = 1
		h = a
		m = b
	i += 1
print(n)


t = int(input())
x = []
y = []
z = []
for i in range(t):
	(n, m) = map(int, input().split())
	x.append(n)
	y.append(m)
s = 1
for j in range(1, t):
	if x[j] == x[j - 1] and y[j] == y[j - 1]:
		s = s + 1
	else:
		z.append(s)
		s = 1
z.append(s)
print(max(z))


n = int(input())
r = 1
last = ''
for i in range(n):
	inp = input()
	if inp == last:
		x += 1
	else:
		x = 1
	r = max(r, x)
	last = inp
print(r)


n = int(input())
x = 1
b = ''
y = []
for i in range(n):
	(h, m) = map(str, input().split())
	a = h + ':' + m
	if a == b:
		x += 1
	else:
		y.append(x)
		x = 1
	b = a
	y.append(x)
print(max(y))


a = []
n = int(input())
for i in range(n):
	(x, y) = (int(x) for x in input().split())
	a.append((x, y))
a = sorted(a)
(ans, tek) = (0, 1)
for i in range(n - 1):
	if a[i] == a[i + 1]:
		tek = tek + 1
	else:
		ans = max(ans, tek)
		tek = 1
ans = max(ans, tek)
print(ans)


l = []
import collections
for _ in range(int(input())):
	(h, m) = list(map(int, input().split()))
	l.append(h * 60 + m)
print(max(collections.Counter(l).values()))


a = b = ans = cnt = -1
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if x == a and y == b:
		cnt += 1
	else:
		if ans < cnt:
			ans = cnt
		cnt = 1
	(a, b) = (x, y)
print(cnt if ans < cnt else ans)


alph = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
time = []
for i in range(1440):
	time.append(0)
for i in range(n):
	(h, m) = map(int, input().split())
	t = 60 * h + m
	time[t] += 1
print(max(time))


n = int(input())
(preda, predb) = (-1, -1)
cur = 1
maxim = 1
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	if a == preda and b == predb:
		cur += 1
		if cur > maxim:
			maxim = cur
	else:
		cur = 1
	preda = a
	predb = b
print(maxim)


s = []
fnoc = 1
noc = 1
n = int(input())
prev = input()
for i in range(n - 1):
	k = input()
	if k == prev:
		noc += 1
	else:
		fnoc = max(noc, fnoc)
		noc = 1
		prev = k
print(max(fnoc, noc))


n = int(input())
maxi = 1
t1 = ''
for i in range(n):
	t2 = input()
	if t1 == t2:
		c += 1
		maxi = max(maxi, c)
	else:
		c = 1
		t1 = t2
print(maxi)


n = int(input())
l = [0] * 1440
for i in range(n):
	b = list(map(int, input().split()))
	l[b[0] * 60 + b[1]] += 1
print(max(l))


n = int(input())
c = 1
d = {}
for i in range(n):
	(h, m) = map(int, input().split())
	h = h * 60
	r = h + m
	if r not in d:
		d[r] = 1
	else:
		d[r] += 1
print(max(d.values()))


n = int(input())
s1 = input()
res = 1
tmp = 1
for i in range(n - 1):
	s2 = input()
	if s2 == s1:
		tmp += 1
	else:
		if res < tmp:
			res = tmp
		tmp = 1
	s1 = s2
	if res < tmp:
		res = tmp
print(res)


n = int(input())
table = dict()
for i in range(n):
	(h, m) = map(int, input().split())
	if h * 100 + m in table:
		table[h * 100 + m] += 1
	else:
		table[h * 100 + m] = 1
ans = 0
for i in table.values():
	ans = max(ans, i)
print(ans)


v = []
s = 1
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	v.append([a, b])
v.sort()
c = 0
for i in range(1, len(v)):
	if v[i] == v[i - 1]:
		s += 1
	else:
		c = max(c, s)
		s = 1
c = max(c, s)
print(c)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict
import bisect
import heapq as hq

def main():
	try:
		(x, y) = (-1, -1)
		ans = 1
		temp = 1
		for i in range(int(input())):
			(a, b) = map(int, input().split())
			if a == x and b == y:
				ans += 1
			else:
				(x, y) = (a, b)
				temp = max(ans, temp)
				ans = 1
		print(max(ans, temp))
	except:
		pass
P = 1000000007

def search(l, x):
	(a, b) = (0, len(l) - 1)
	while a <= b:
		k = (a + b) // 2
		if l[k] == x:
			return k
		elif l[k] < x:
			a = k + 1
		else:
			b = k - 1
main()


n = int(input())
h = list()
m = list()
count = 1
maxCount = 0
for i in range(n):
	(a, b) = map(int, input().split())
	h.append(a)
	m.append(b)
for j in range(n - 1):
	if h[j] == h[j + 1] and m[j] == m[j + 1]:
		count += 1
	else:
		if maxCount < count:
			maxCount = count
		count = 1
if maxCount < count:
	maxCount = count
print(maxCount)


n = int(input())
a = [0] * n
b = [0] * n
for i in range(n):
	(a[i], b[i]) = map(int, input().split())
k = x = 1
for i in range(n - 1):
	if a[i] == a[i + 1] and b[i] == b[i + 1]:
		k += 1
	else:
		k = 1
	if k > x:
		x = k
print(x)


t = int(input())
a = [0] * (24 * 60)
for x in range(0, t):
	(n, m) = map(int, input().split(' '))
	a[n * 60 + m] += 1
print(max(a))


n = int(input())
if n == 1:
	print(1)
	exit()
current_time = []
current_num = 0
max_num = 0
for i in range(n):
	t = list(map(int, input().split()))
	if t == current_time:
		current_num += 1
	else:
		current_time = t
		max_num = max(current_num, max_num)
		current_num = 1
max_num = max(max_num, current_num)
print(max_num)


n = int(input())
h_l = []
m_l = []
for i in range(n):
	(h, m) = map(int, input().split())
	h_l.append(h)
	m_l.append(m)
count = 1
max_c = 1
for i in range(n - 1):
	if h_l[i] == h_l[i + 1] and m_l[i] == m_l[i + 1]:
		count += 1
	else:
		max_c = max(max_c, count)
		count = 1
max_c = max(max_c, count)
print(max_c)


cust = int(input())
(w, wB, hL, mL) = (1, 1, -1, -1)
for i in range(cust):
	(h, m) = map(int, input().split())
	if hL == h and mL == m:
		w += 1
		if wB < w:
			wB = w
	else:
		w = 1
	(hL, mL) = (h, m)
print(wB)


n = int(input())
previous = list(map(int, input().split()))
maxscore = 1
score = 1
for t in range(1, n):
	current = list(map(int, input().split()))
	if previous == current:
		score += 1
	else:
		if score > maxscore:
			maxscore = score
		score = 1
		previous = current
if score > maxscore:
	maxscore = score
print(maxscore)


registers = max_registers = 1
(n, current) = (int(input()), input())
for _ in range(n - 1):
	next = input()
	if current == next:
		registers += 1
	else:
		(registers, max_registers) = (1, max(registers, max_registers))
	current = next
print(max(registers, max_registers))


n = int(input())
c = 1
stk = []
for _ in range(n):
	(h, m) = list(map(int, input().split()))
	if len(stk) == 0:
		stk.append((h, m))
	else:
		if h != stk[-1][0] or m != stk[-1][1]:
			while len(stk) != 0:
				stk.pop()
		stk.append((h, m))
	c = max(c, len(stk))
print(c)


n = int(input())
res = 1
aux = 1
h1 = input()
for _ in range(n - 1):
	h2 = input()
	if h1 == h2:
		aux += 1
		if aux > res:
			res = aux
	else:
		aux = 1
	h1 = h2
print(str(res))


from collections import *
a = []
for i in range(int(input())):
	x = input().replace(' ', '-')
	a.append(x)
print(Counter(a).most_common()[0][1])


l = []
for x in range(int(input())):
	(a, b) = input().split()
	l.append(a + b)
(c, s) = (0, 0)
for x in range(len(l) - 1):
	if l[x] != l[x + 1]:
		s = max(s, x - c + 1)
		c = x + 1
s = max(s, len(l) - c)
print(s)


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


n = int(input())
f = []
for i in range(n):
	h = input()
	f += [h]
count = 0
count1 = 0
for i in range(0, len(f) - 1):
	if f[i] == f[i + 1]:
		count += 1
		if count > count1:
			count1 = count
	else:
		count = 0
print(count1 + 1)


num_visitors = int(input())
(current_hour, current_minute) = input().split()
solution_candidate = 1
solution = 1
for _ in range(num_visitors - 1):
	(hour, minute) = input().split()
	if hour == current_hour and minute == current_minute:
		solution_candidate += 1
	else:
		current_hour = hour
		current_minute = minute
		solution = max(solution, solution_candidate)
		solution_candidate = 1
solution = max(solution, solution_candidate)
print(solution)


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
import heapq
I = sys.stdin.readline
alpha = 'abcdefghijklmnopqrstuvwxyz'
mod = 10 ** 9 + 7

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

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

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def ispali(s):
	i = 0
	j = len(s) - 1
	while i < j:
		if s[i] != s[j]:
			return False
		i += 1
		j -= 1
	return True

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	n = ii()
	d = defaultdict(int)
	for i in range(n):
		(h, m) = mi()
		d[h, m] += 1
	print(max(d.values()))
main()


n = int(input())
time = [int(i) for i in input().split()]
times = [time]
cashes = []
customers = 1
for x in range(1, n):
	time = [int(i) for i in input().split()]
	times.append(time)
	if times[x - 1] == times[x]:
		customers += 1
	else:
		cashes.append(customers)
		customers = 1
if customers != 1 or n == 1:
	cashes.append(customers)
print(max(cashes))


import math
n = int(input())
cnt = 1
(lh, lm) = map(int, input().split())
temp = 1
for i in range(1, n):
	(h, m) = map(int, input().split())
	if lh == h and lm == m:
		temp += 1
	else:
		if temp > cnt:
			cnt = temp
		temp = 1
		lh = h
		lm = m
if temp > cnt:
	cnt = temp
print(cnt)


dic = {}
for i in range(int(input())):
	(h, m) = list(map(int, input().split()))
	if dic.__contains__((h, m)):
		dic[h, m] += 1
	else:
		dic[h, m] = 1
print(max(dic.values()))


n = int(input())
mx = 1
cnt = 1
last_h = -1
last_m = -1
for i in range(0, n):
	now = list(map(int, str(input()).split()))
	now_h = now[0]
	now_m = now[1]
	if now_h == last_h and now_m == last_m:
		cnt = cnt + 1
		mx = mx if mx > cnt else cnt
	else:
		cnt = 1
	last_h = now_h
	last_m = now_m
print(mx)


n = int(input())
time_count_pairs = {}
for i in range(n):
	time = input()
	if not time_count_pairs.get(time):
		time_count_pairs[time] = 1
	else:
		time_count_pairs[time] += 1
count_max = 0
for i in list(time_count_pairs.values()):
	if i > count_max:
		count_max = i
print(count_max)


n = int(input())
cnt = 0
ans = 0
pre = ''
for i in range(n):
	s = input()
	if s == pre:
		cnt += 1
	else:
		if cnt > ans:
			ans = cnt
		cnt = 1
		pre = s
if cnt > ans:
	ans = cnt
print(ans)


import sys
input = sys.stdin.readline
output = sys.stdout
dic = {}
t = int(input())
for i in range(t):
	l = input().strip()
	if l not in dic.keys():
		dic[l] = 1
	else:
		dic[l] += 1
output.write(str(max(dic.values())))


n = int(input())
a = []
for i in range(n):
	a.append(input())
res = 1
pos = 0
while pos < n:
	pos1 = pos
	while pos1 + 1 < n and a[pos1 + 1] == a[pos]:
		pos1 += 1
	res = max(res, pos1 - pos + 1)
	pos = pos1 + 1
print(res)


n = int(input())
x = []
y = []
for i in range(n):
	(a, b) = map(int, input().split())
	x.append(a)
	y.append(b)
count = 1
temp = 1
for i in range(n - 1):
	if x[i] == x[i + 1] and y[i] == y[i + 1]:
		count += 1
	else:
		if temp < count:
			temp = count
		count = 1
if temp < count:
	temp = count
print(temp)


n = int(input())
l = []
while n:
	m = [int(i) for i in input().split(' ')]
	l.append((m[0], m[1]))
	n -= 1
d = {}
for i in l:
	d[i] = 0
for i in l:
	d[i] += 1
print(max(d.values()))


n = int(input())
max_count = 1
curr_set = None
curr_count = 1
for i in range(n):
	h_and_m = str(input().strip())
	new_set = h_and_m
	if curr_set == None:
		curr_set = new_set
		curr_count = 1
	elif curr_set == new_set:
		curr_count += 1
	else:
		curr_set = new_set
		curr_count = 1
	if curr_count > max_count:
		max_count = curr_count
print(max_count)


def input_persons() -> dict:
	n = int(input())
	result = {'length': n, 'hour': [], 'minute': []}
	for _ in range(n):
		(h, m) = map(int, input().split())
		result['hour'].append(h)
		result['minute'].append(m)
	return result

def count_cash(arrivals: dict) -> int:
	min_cash = 0
	i = 0
	while i < arrivals['length']:
		j = i
		while j < arrivals['length'] - 1 and arrivals['hour'][j + 1] == arrivals['hour'][j] and (arrivals['minute'][j + 1] == arrivals['minute'][j]):
			j += 1
		cash = j - i + 1
		if cash > min_cash:
			min_cash = cash
		i = j + 1
	return min_cash
print(count_cash(input_persons()))


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

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

def sip():
	return sys.stdin.readline()

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

def mips():
	return map(str, sys.stdin.readline().split())

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

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

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

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = ip()
dick = {}
while n:
	n -= 1
	k = sip()
	if k not in dick:
		dick[k] = 1
	else:
		dick[k] += 1
val = 1
for item in dick:
	if dick[item] > val:
		val = dick[item]
print(val)


m = {}
n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	k = '{}:{}'.format(a, b)
	if m.get(k) is None:
		m[k] = 1
	else:
		m[k] += 1
print(max(m.values()))


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


n = int(input())
a = [0] * 1500
result = 0
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	a[x * 60 + y] += 1
result = max(a)
print(result)


n = int(input())
x = {}
for _ in range(n):
	t = input()
	x[t] = x.setdefault(t, 0) + 1
mx = 0
for b in x:
	if x[b] > mx:
		mx = x[b]
print(mx)


n = int(input())
visits = list(map(lambda x: input(), range(n)))
max_visit = 1
clients = 1
for i in range(1, n):
	if visits[i] == visits[i - 1]:
		clients += 1
		if clients > max_visit:
			max_visit = clients
	else:
		clients = 1
print(max_visit)


n = int(input())
x = 1
m = 1
s = ''
for i in range(n):
	s0 = s
	s = input()
	if s == s0:
		x += 1
	else:
		x = 1
	if x > m:
		m = x
print(m)


n = int(input())
(s, r) = (input(), 1)
max_r = 1
for _ in range(n - 1):
	x = input()
	if x == s:
		r += 1
	else:
		if r > max_r:
			max_r = r
		(s, r) = (x, 1)
	if r > max_r:
		max_r = r
print(max_r)


n = int(input())
d = set()
count = 1
l = []
for i in range(n):
	s = str(input())
	if s in d:
		count = count + 1
	else:
		l.append(count)
		count = 1
		d.add(s)
l.append(count)
print(max(l))


money = 1
customers = int(input())
(hour, minute) = map(int, input().split())
ans = []
for ins in range(customers - 1):
	(x, y) = map(int, input().split())
	if hour == x and minute == y:
		money += 1
	else:
		ans.append(money)
		money = 1
		hour = x
		minute = y
ans.append(money)
print(max(ans))


n = int(input())
hl = 13
ml = 60
kassa = 1
km = 1
for i in range(n):
	(h, m) = map(int, input().split())
	if h == hl and m == ml:
		kassa += 1
		if kassa > km:
			km += 1
	else:
		kassa = 1
	hl = h
	ml = m
print(km)


n = int(input())
a = {}
for i in range(n):
	(p, q) = list(map(int, input().split()))
	k = p * 60 + q
	if k in a:
		a[k] += 1
	else:
		a[k] = 1
l = float('-inf')
for i in a:
	if a[i] > l:
		l = a[i]
print(l)


from collections import Counter
n = int(input())
l = []
for i in range(n):
	(a, b) = tuple(input().split())
	l.append((a, b))
l = Counter(l).most_common(1)
print(l[0][1])


from collections import Counter
t = int(input())
res = []
for i in range(t):
	res.append(input())
x = Counter(res)
print(max(x.values()))


l = []
h = 0
y = 0
for i in range(int(input())):
	k = list(map(int, input().split()))
	if k != l:
		l = k
		h = 0
	else:
		l = k
		h = h + 1
		if h > y:
			y = h
print(y + 1)


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')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def solve():
	n = readint()
	arr = [readarri() for _ in range(n)]
	curAns = 1
	bffr = 1
	prev = arr[0]
	for i in range(1, n):
		if arr[i] == prev:
			bffr += 1
		else:
			curAns = max(curAns, bffr)
			prev = arr[i]
			bffr = 1
	if bffr > 1:
		curAns = max(curAns, bffr)
	print(curAns)

def main():
	t = 1
	for _ in range(t):
		solve()
main()


n = int(input())
dic = {}
for _ in range(n):
	time = tuple(input().split())
	if time in dic:
		dic[time] += 1
	else:
		dic[time] = 1
print(max(dic.values()))


def time(h, m):
	return h * 60 + m
n = int(input())
arrival = []
for i in range(n):
	(h, m) = [int(x) for x in input().split()]
	arrival.append(time(h, m))
dic = {}
for item in arrival:
	dic[item] = dic.get(item, 0) + 1
print(max(dic.values()))


x = int(input())
(j, d) = map(str, input().split())
f = j + d
count = 1
max = count
for i in range(x - 1):
	(h, m) = map(str, input().split())
	t = h + m
	if f == t:
		count += 1
	else:
		if count > max:
			max = count
		count = 1
	if count > max:
		max = count
	f = t
print(max)


cases = int(input())
ans = 1
prev = -1
mx = -1
while cases:
	cases -= 1
	(h, m) = map(int, input().split())
	if (h, m) == prev:
		ans += 1
	else:
		prev = (h, m)
		mx = max(ans, mx)
		ans = 1
mx = max(ans, mx)
print(mx)


time = [[0] * 60 for _ in range(24)]
n = int(input())
cmax = 0
for _ in range(n):
	(h, m) = map(int, input().split())
	time[h][m] += 1
	cmax = max(cmax, time[h][m])
print(cmax)


n = int(input())
(h1, h2, m1, m2) = (0, 0, 0, 0)
(fc, c) = (1, 1)
(h1, m1) = map(int, input().split())
for i in range(n - 1):
	(h2, m2) = map(int, input().split())
	if h2 == h1:
		if m2 == m1:
			c += 1
		else:
			c = 1
	else:
		c = 1
	fc = max(fc, c)
	h1 = h2
	m1 = m2
print(fc)


n = int(input())
i = int(1)
cnt = int(1)
ans = int(1)
(x, y) = input().split()
x = int(x)
y = int(y)
while i < n:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if a == x and b == y:
		cnt = cnt + 1
	else:
		ans = max(ans, cnt)
		cnt = 1
	i = i + 1
	x = int(a)
	y = int(b)
ans = max(ans, cnt)
print(ans)


a = int(input())
n = -1
d = -1
e = 1
m = 1
for i in range(1, a + 1):
	(x, y) = map(int, input().split())
	if n == x and d == y:
		e += 1
		if e > m:
			m = e
	else:
		n = x
		d = y
		e = 1
print(m)


freq = {}
for _ in range(int(input())):
	key = tuple(input().split())
	freq[key] = freq.setdefault(key, 0) + 1
print(max(freq.values()))


import collections
a = int(input())
c = []
for i in range(0, a):
	c.append(str(input()))
counter = collections.Counter(c)
print(max(counter.values()))


from collections import Counter
m = int(input())
c = 1
old = 0
l = []
for i in range(0, m):
	(hr, mint) = map(int, input().split())
	val = 100 * hr + mint
	l.append(val)
cnt = Counter(l)
a = cnt.most_common(1)
print(a[0][1])


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

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def abs(x):
	return x if x >= 0 else -x

def sumelem(x, start, end):
	sum = 0
	for i in range(start, end + 1):
		sum += x[i]
	return sum
counter = dict()
for t in range(int(input())):
	(h, m) = list(map(int, input().split()))
	time = 60 * h + m
	counter.setdefault(time, 0)
	counter[time] += 1
li = list(counter.values())
li.sort()
print(li[-1])


dic = {}
for i in range(int(input())):
	a = input()
	dic[a] = dic.get(a, 0) + 1
print(max(dic.values()))


t = int(input())
d = {}
while t > 0:
	t = t - 1
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1
print(max(d.values()))


n = int(input())
t = {}
for i in range(n):
	temp = input()
	if t.__contains__(temp):
		t[temp] += 1
	else:
		t[temp] = 1
print(max(t.values()))


n = int(input())
l = [[0] * 60 for i in range(24)]
s = []
for i in range(n):
	(a, b) = map(int, input().split())
	l[a][b] += 1
flat_list = []
for sublist in l:
	for item in sublist:
		flat_list.append(item)
print(max(flat_list))


n = int(input())
ans = []
for i in range(n):
	(a, b) = map(int, input().split())
	ans.append([a, b])
count = 1
p = -1
for i in range(0, len(ans) - 1):
	if ans[i] == ans[i + 1]:
		count += 1
	else:
		p = max(p, count)
		count = 1
p = max(p, count)
print(p)


b = []
for i in range(int(input())):
	t = input().split()
	b.append(t)
b.append('#')
c = 1
l = []
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		c += 1
	else:
		l.append(c)
		c = 1
print(max(l))


n = int(input().strip())
mn = 0
cashiers = 1
l = ''
for i in range(n):
	t = input().strip()
	if t == l:
		mn += 1
	else:
		mn = 1
	cashiers = max(mn, cashiers)
	l = t
print(cashiers)


n = int(input())
(a, b) = map(int, input().rstrip().split())
count = maxi = 0
for _ in range(n - 1):
	(c, d) = map(int, input().rstrip().split())
	if a == c and b == d:
		count += 1
	else:
		maxi = max(maxi, count)
		count = 0
	(a, b) = (c, d)
print(max(maxi, count) + 1)


x = int(input())
t = input()
f = 1
m = 0
for i in range(x - 1):
	i = input()
	if i == t:
		f += 1
	else:
		if m < f:
			m = f
		t = i
		f = 1
if m < f:
	m = f
print(m)


n = int(input())
hours = [[0] * 60 for i in range(24)]
for i in range(n):
	(hour, minute) = [int(x) for x in input().split(' ')]
	hours[hour][minute] += 1
print(max([item for sublist in hours for item in sublist]))


n = int(input())
(h, m) = (-1, -1)
out = ''
for _ in range(n):
	(a, b) = map(int, input().split())
	if h == a and b == m:
		out = out + '1'
	else:
		out = out + '0'
	h = a
	m = b
out = out.split('0')
maxm = 0
for i in out:
	if len(i) > maxm:
		maxm = len(i)
print(maxm + 1)


n = int(input())
hour = -1
minutes = -1
count = 1
min = 0
for i in range(n):
	(h, m) = map(int, input().split())
	if h == hour and m == minutes:
		count += 1
	else:
		count = 1
	if count > min:
		min = count
	hour = h
	minutes = m
print(min)


from collections import Counter
times = []
for i in range(int(input().strip())):
	(hr, mi) = map(int, input().strip().split())
	times.append(hr * 60 + mi)
print(max(list(Counter(times).values())))


n = int(input())
dic = dict()
for i in range(n):
	str1 = input()
	dic[str1] = dic.get(str1, 0) + 1
print(max(dic.values()))


n = int(input())
customers = {}
ans = 1
for _ in range(n):
	(h, m) = (int(x) for x in input().split())
	m += h * 60
	if m in customers:
		customers[m] += 1
	else:
		customers[m] = 1
	ans = max(ans, customers[m])
print(ans)


n = int(input())
time = {}
for i in range(n):
	(h, m) = map(int, input().split())
	if (h, m) in time:
		time[h, m] += 1
	else:
		time[h, m] = 1
ans = 0
for i in time:
	if time[i] > ans:
		ans = time[i]
print(ans)


from sys import stdin
n = int(stdin.readline())
t = 1
res = 1
(h_prev, m_prev) = list(map(int, stdin.readline().split()))
for _ in range(n - 1):
	(h, m) = list(map(int, stdin.readline().split()))
	if h == h_prev and m == m_prev:
		t += 1
		if t > res:
			res = t
	else:
		t = 1
	(h_prev, m_prev) = (h, m)
print(res)


n = int(input())
(m, h) = map(int, input().split())
nr = 1
nr1 = 1
while n - 1 > 0:
	(x, y) = map(int, input().split())
	if x == m and y == h:
		nr1 += 1
	else:
		(m, h, nr1) = (x, y, 1)
	if nr1 > nr:
		nr = nr1
	n -= 1
print(nr)


n = int(input())
nb = 1
b = 1
(ch, cm) = map(int, input().split(' '))
for i in range(1, n):
	(h, m) = map(int, input().split(' '))
	if ch == h and cm == m:
		nb += 1
		if nb > b:
			b = nb
	else:
		(ch, cm) = (h, m)
		nb = 1
print(b)


customers = int(input())
prev_hours = prev_minutes = None
casses = max_casses = 1
for i in range(customers):
	(hours, minutes) = map(int, input().split())
	if hours == prev_hours and minutes == prev_minutes:
		casses += 1
	else:
		casses = 1
	prev_hours = hours
	prev_minutes = minutes
	if casses > max_casses:
		max_casses = casses
print(max_casses)


n = int(input())
lsh = []
lsm = []
for i in range(n):
	(h, m) = [int(i) for i in input().split()]
	lsh.append(h)
	lsm.append(m)
mac = 1
i = 0
while i < n:
	br = 0
	count = 1
	j = i
	while 1:
		if j <= n - 2:
			if lsh[j] == lsh[j + 1]:
				if lsm[j] == lsm[j + 1]:
					count += 1
				else:
					count = 1
				if count > mac:
					mac = count
				j += 1
			else:
				i = j + 1
				br = 1
				break
		else:
			i = j + 1
			br = 1
			break
	if br == 0:
		i += 1
print(mac)


n = int(input())
cus = dict()
max_t = 1
for _ in range(n):
	t = input()
	if t not in cus:
		cus[t] = 0
	cus[t] += 1
	if cus[t] > max_t:
		max_t = cus[t]
print(max_t)


n = int(input())
line = input()
occurrences = []
i = 0
count = 1
while i < n - 1:
	new_line = input()
	if new_line == line:
		count += 1
	else:
		occurrences.append(count)
		count = 1
		line = new_line
	i += 1
occurrences.append(count)
print(max(occurrences))


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


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

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

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
n = I()
d = dict()
for i in range(n):
	(h, m) = R()
	d[60 * h + m] = 1 if not 60 * h + m in d else d[60 * h + m] + 1
print(max([d[i] for i in d]))


n = int(input())
k = 1
(a1, b1) = [int(i) for i in input().split()]
c = 1
for i in range(n - 1):
	(a, b) = [int(i) for i in input().split()]
	if a == a1 and b == b1:
		c += 1
	else:
		k = max(c, k)
		c = 1
	(a1, b1) = (a, b)
k = max(c, k)
print(k)


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


n = int(input())
(h, m) = [int(x) for x in input().split()]
cash = 1
maxCash = 1
h0 = h
m0 = m
for i in range(1, n):
	(h, m) = [int(x) for x in input().split()]
	if h == h0 and m == m0:
		cash += 1
		if cash > maxCash:
			maxCash = cash
	else:
		cash = 1
	h0 = h
	m0 = m
print(maxCash)


n = int(input())
res = 1
prev = list(map(int, input().split()))
temp = 1
for i in range(1, n):
	t = list(map(int, input().split()))
	if t[1] == prev[1] and t[0] == prev[0]:
		temp += 1
	else:
		res = max(res, temp)
		temp = 1
	prev[0] = t[0]
	prev[1] = t[1]
	res = max(res, temp)
print(res)


n = int(input())
equals = 1
max_eq = equals
prev = -1
for i in range(n):
	(h, m) = map(int, input().split())
	t = h * 60 + m
	if t == prev:
		equals += 1
		max_eq = max(max_eq, equals)
	else:
		equals = 1
		prev = t
print(max_eq)


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


R = lambda : [*map(int, input().split())]
n = R()
line = {}
for i in range(n[0]):
	s = input()
	line[s] = line.get(s, 0) + 1
needs = max(line.values())
print(needs)


n = int(input())
time = []
time_z = []
for _ in range(n):
	arr = input().split()
	if arr[0] == '0':
		time_z.append(arr[1])
	else:
		if int(arr[1]) < 10:
			arr[1] = '0' + arr[1]
		time.append(arr[0] + arr[1])
times = list(map(int, time))
time_z = list(map(int, time_z))

def search(nums):
	d = {}
	count = 0
	for el in nums:
		d[el] = d[el] + 1 if el in d.keys() else 1
		if d[el] > count:
			count = d[el]
	return count
res = search(times)
res_z = search(time_z)
if res > res_z:
	print(res)
else:
	print(res_z)


n = int(input())
l = []
o = []
(a, b) = map(int, input().split())
p1 = a * 60 + b
e = 1
ma = 0
for i in range(1, n):
	(a, b) = map(int, input().split())
	p = a * 60 + b
	if p == p1:
		e += 1
	else:
		if e > ma:
			ma = e
		p1 = p
		e = 1
if e > ma:
	ma = e
print(ma)


from collections import Counter
n = int(input())
t = []
for i in range(n):
	(h, m) = input().split()
	(h, m) = (int(h), int(m))
	t.append((h, m))
x = Counter(tuple(t))
print(max(x.values()))


x = 0
c = 0
d = 0
r = 1
cnt = 1
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if r == 1:
		cnt = 1
	elif c == a and d == b:
		cnt = cnt + 1
	else:
		cnt = 1
	if x <= cnt:
		x = cnt
	r = r + 1
	c = a
	d = b
print(x)


n = int(input())
count = 0
picks = []
x = 0
for i in range(n):
	(h, m) = map(str, input().split())
	if h + m == x:
		count += 1
		picks.append(count)
	else:
		count = 1
	x = h + m
if len(picks) == 0:
	print(1)
else:
	print(max(picks))


import math
from itertools import groupby
n = int(input())
i = 0
q = []
while i < n:
	l = input().split(' ')
	w = l[0] + l[1]
	q.append(w)
	i += 1
h = len(q)
j = 0
p = 0
z = 0
b = []
b = [len(list(group)) for (key, group) in groupby(q)]
b.sort()
k = len(b)
print(b[k - 1])


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


l = [0 for x in range(5000)]
n = int(input().strip(' '))
for ___ in range(n):
	(a, b) = map(int, input().split())
	l[a * 60 + b] += 1
ans = max(l)
print(ans)


checkouts = 0
max_checkouts = 0
time = ''
customers = int(input())
for i in range(customers):
	next_time = input()
	if next_time == time:
		checkouts += 1
	else:
		max_checkouts = max(max_checkouts, checkouts)
		checkouts = 0
		time = next_time
max_checkouts = max(max_checkouts, checkouts)
print(max_checkouts + 1)


n = int(input())
max_num = 1
curr_num = 1
curr_item = str(input())
pass_item = curr_item
for i in range(1, n):
	curr_item = str(input())
	if curr_item == pass_item:
		curr_num += 1
	else:
		if curr_num > max_num:
			max_num = curr_num
		curr_num = 1
	pass_item = curr_item
if curr_num > max_num:
	max_num = curr_num
print(max_num)


n = int(input())
(c, p) = (1, '')
m = 1
for _ in range(n):
	x = input()
	if x == p:
		c += 1
	else:
		m = max(c, m)
		c = 1
		p = x
m = max(c, m)
print(m)


n = int(input())
a = []
for i in range(n):
	(h, m) = map(int, input().split())
	a.append((h, m))
a.sort()
x = 1
max = 1
for i in range(n - 1):
	if a[i] == a[i + 1]:
		x += 1
		if x > max:
			max = x
	else:
		x = 1
print(max)


n = int(input())
(w, wb, hl, ml) = (1, 1, -1, -1)
for i in range(n):
	(h, m) = map(int, input().split())
	if hl == h and ml == m:
		w += 1
		if wb < w:
			wb = w
	else:
		w = 1
	(hl, ml) = (h, m)
print(wb)


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


tt = [0] * 24 * 60
n = int(input())
k = 0
for i in range(n):
	(h, m) = map(int, input().split())
	tt[h * 60 + m] += 1
	if tt[h * 60 + m] > k:
		k = tt[h * 60 + m]
print(k)


x = int(input())
vec = []
acu1 = 1
acu2 = 0
for i in range(0, x, 1):
	h = input()
	vec.append(h)
for i in range(0, x - 1, 1):
	q = vec[i]
	e = vec[i + 1]
	if q == e:
		acu1 = acu1 + 1
	if q != e:
		if acu1 > acu2:
			acu2 = acu1
		acu1 = 1
if acu2 == 0:
	acu2 = acu1
if acu1 > acu2:
	acu2 = acu1
print(acu2)


n = int(input())
f = ['s']
count = 0
count1 = 0
for i in range(n):
	h = input()
	f += [h]
	if f[-1] == f[-2]:
		count += 1
		if count > count1:
			count1 += 1
	else:
		count = 0
print(count1 + 1)


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


x = [0] * (24 * 60)
for i in range(int(input())):
	(a, b) = map(int, input().split())
	x[a * 60 + b] += 1
print(max(x))


n = int(input())
if 1 <= n <= 10 ** 5:
	k = k1 = 1
	r = ''
	for i in range(n):
		hi_mi = input()
		if hi_mi == r:
			k1 += 1
		else:
			k1 = 1
		if k1 > k:
			k = k1
		r = hi_mi
	print(k)


print(__import__('collections').Counter((input() for _ in range(int(input())))).most_common()[0][1])


n = int(input())
d1 = {}
maxm = 0
for i in range(0, n):
	t1 = tuple(map(int, input().split()))
	if t1 in d1.keys():
		d1[t1] += 1
		maxm = max(d1[t1], maxm)
	else:
		d1[t1] = 1
		maxm = max(d1[t1], maxm)
print(maxm)


n = int(input())
max_ = 0
d = {}
for _ in range(n):
	(h, m) = [int(i) for i in input().split()]
	if (h, m) in d:
		d[h, m] += 1
		max_ = max(d[h, m], max_)
	else:
		d[h, m] = 1
		max_ = max(1, max_)
print(max_)


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


n = int(input())
d = [[0] * 60 for _ in range(24)]
for i in range(n):
	(a, b) = map(int, input().split())
	d[a][b] += 1
s = 0
for i in range(len(d)):
	if max(d[i]) > s:
		s = max(d[i])
print(s)


t = int(input())
list = {}
for i in range(t):
	(h, m) = [int(x) for x in input().split()]
	list[h, m] = list.get((h, m), 0) + 1
m = 1
for i in list:
	m = max(m, list[i])
print(m)


n = int(input())
d = []
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	d.append([x, y])
d.sort()
maxc = 1
c = 0
for i in range(1, n):
	if d[i][0] == d[i - 1][0] and d[i][1] == d[i - 1][1]:
		if c == 0:
			c += 2
		else:
			c += 1
		if c > maxc:
			maxc = c
	else:
		if c > maxc:
			maxc = c
		c = 0
print(maxc)


n = int(input())
h = {}
p = []
for _ in range(n):
	a = input()
	p.append(a)
for i in p:
	h[i] = h.get(i, 0) + 1
print(max(h.values()))


n = int(input())
hash_map = {}
for i in range(n):
	(x, y) = map(int, input().split())
	if str(x) + ':' + str(y) in hash_map:
		hash_map[str(x) + ':' + str(y)] += 1
		continue
	else:
		hash_map[str(x) + ':' + str(y)] = 1
m = -100000
for key in hash_map:
	m = max(m, hash_map[key])
print(m)


n = int(input())
l = []
for i in range(n):
	(m, k) = map(int, input().split())
	l.append((m, k))
c = []
cnt = 0
for j in range(n - 1):
	if l[j] == l[j + 1]:
		cnt += 1
		c.append(cnt + 1)
	else:
		cnt = 0
if len(c) == 0:
	print(1)
else:
	print(max(c))


n = int(input().strip())
llp = []
for i in range(n):
	k = list(map(int, input().split()))
	llp.append(k[0] * 60 + k[1])
javob = [1]
k = 1
m = llp[0]
for i in llp[1:]:
	if m == i:
		k += 1
	else:
		m = i
		javob.append(k)
		k = 1
if k != 1:
	javob.append(k)
print(max(javob))


(arr, c) = ([], 0)
for _ in range(int(input())):
	(h, m) = map(int, input().split())
	arr.append((h, m))
	c += 1
arr = sorted(arr)
(waiter, i, ans) = (0, 1, 1)
while i < c:
	if arr[i - 1][0] == arr[i][0] and arr[i - 1][1] == arr[i][1]:
		if waiter == 0:
			ans += 1
		else:
			waiter -= 1
	else:
		waiter = ans
		waiter -= 1
	i += 1
print(ans)


n = int(input())
(curr_h, curr_m) = (-1, -1)
cnt = 0
mx = 0
for i in range(n):
	(h, m) = list(map(int, input().split()))
	if h == curr_h and m == curr_m:
		cnt += 1
		mx = max(mx, cnt)
	else:
		cnt = 1
		mx = max(mx, cnt)
		(curr_h, curr_m) = (h, m)
print(mx)


n = int(input())
h = [0] * n
m = [0] * n
k = [0] * n
for i in range(n):
	(h[i], m[i]) = input().split()
t = [0] * n
for i in range(n):
	t[i] = int(h[i]) * 60 + int(m[i])
c = 1
for i in range(1, n):
	if t[i] == t[i - 1]:
		c = c + 1
		k.append(c)
	else:
		c = 1
if max(k) > 1:
	c = max(k)
print(c)


d = {}
for _ in range(int(input())):
	x = input()
	if x not in d:
		d[x] = 1
	else:
		d[x] += 1
print(max(map(lambda x: d[x], d)))


def main():
	n = int(input())
	d = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		if (x, y) not in d:
			d[x, y] = 1
		else:
			d[x, y] += 1
	dd = sorted(d.items(), key=lambda x: x[1], reverse=True)
	print(dd[0][1])
main()


R = lambda : list(map(int, input().split()))
n = int(input())
xh = 0
xm = 0
c = 0
x = 0
for _ in range(n):
	(h, m) = R()
	if xh == h and xm == m:
		x += 1
	else:
		xh = h
		xm = m
		c = max(c, x)
		x = 1
c = max(c, x)
print(c)


visitors = int(input())
times = []
unique = {}
n = 0
for x in range(visitors):
	time = input()
	if not time in unique:
		unique[time] = 1
	else:
		unique[time] += 1
	if unique[time] > n:
		n += 1
print(n)