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

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


-----Input-----

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

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


-----Output-----

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


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

Output
2

Input
3
111
111
111

Output
3



-----Note-----

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

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

Difficulty: interview

Starter code:

Solutions:
n = int(input())

d = {}

for i in range(n):
	s = input()
	if s in d:
		d[s] += 1
	else:
		d[s] = 1

print(d[max(d,key=d.get)])

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

print(max(d.values()))


n = int(input())
p = []
for i in range(n):
   p.append(list(input()))
max = 0
for i in range(n):
   q = p
   for t in range(n):
      if q[i][t] == '0':
          for k in range(n):
                 if q[k][t] == '0':
                    q[k][t] = '1'
                 else:
                    q[k][t] = '0'
   col = 0
   for t in range(n):
      sum = 0
      for e in range(n):
         if q[t][e] == '1':
            sum += 1
      if sum == n:
           col += 1
   if col > max:
      max = col
print(max)
      


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

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


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

n = int(input())
mt = dict()

for i in range(n):
    line = input()
    if line in mt:
        mt[line] += 1
    else:
        mt[line] = 1

print(max(mt.values()))

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


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

n = int(input())
a = []
for i in range(n):
    a.append(input())
for i in range(n):
    t = a[i]
    a[i] = []
    for j in range(n):
        a[i].append(t[j] == '1')
#print(a)
maxRes = -1
for i in range(n):
    s = []
    b = a[:]
    for j in range(n):
        s.append(not a[i][j])
        b[i][j] = True
    for j in range(i):
        for k in range(n):
            if s[k]:
                b[j][k] = not b[j][k]
    #print(s)
    for j in range(i+1, n):
        for k in range(n):
            if s[k]:
                b[j][k] = not b[j][k]
    res = 0
    for j in range(n):
        t = True
        for k in range(n):
            if not b[j][k]:
                t = False
        if t:
            res += 1
    maxRes = max(maxRes, res)
    #print(b)
    #print()
print(maxRes)


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

def __starting_point():
    main()
    

__starting_point()

from collections import Counter

n = int(input())

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

print(Counter(grid).most_common(1)[0][1])


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time

n       = int(input())
table   = []

for i in range(n):
    table.append([int(i) for i in input().split()])

start = time.time()
ans   = 0

for i in range(n):
    buf = 0
    for j in range(n):
        if table[i] == table[j]:
            buf += 1
    if buf > ans:
        ans = buf

print(ans)
finish = time.time()
#print(finish - start)


#!/usr/bin/env python3

n = int(input())

rows = []

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


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

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

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

def dirtyIdxs(row):
	return list(i for i, e in enumerate(row) if e == '1')

print(max(numCleanRows(sweepColumns(rows, dirtyIdxs(row))) for row in rows))

def main():
    n = int(input())
    grid = [input() for _ in range(n)]

    row_map = {}
    max_frequency = 0
    for row in grid:
        if row in row_map:
            row_map[row] += 1
        else:
            row_map[row] = 1

        max_frequency = max(max_frequency, row_map[row])

    print(max_frequency)


def __starting_point():
    main()
__starting_point()

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 missingdays <missingdays@missingdays>
#
# Distributed under terms of the MIT license.

"""

"""

def check(c):
    for char in c:
        if char == '0':
            return False
    return True    

n = int(input())

s = []
eq = [0 for i in range(n)]
for i in range(n):
    s.append(input())

clean = 0

for c in s:
    if check(c):
        clean += 1

for i in range(n):
    for j in range(i, n):
        if s[i] == s[j]:
            eq[i] += 1
print(max(clean, max(eq)))            


n = int(input())

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



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

# Guide:
#   1. construct complex data types while reading (e.g. graph adj list)
#   2. avoid any non-necessary time/memory usage
#   3. avoid templates and write more from scratch
#   4. switch to "flat" implementations

def VI(): return list(map(int,input().split()))
def I(): return int(input())
def LIST(n,m=None): return [0]*n if m is None else [[0]*m for i in range(n)]
def ELIST(n): return [[] for i in range(n)]
def MI(n=None,m=None): # input matrix of integers
    if n is None: n,m = VI()
    arr = LIST(n)
    for i in range(n): arr[i] = VI()
    return arr
def MS(n=None,m=None): # input matrix of strings
    if n is None: n,m = VI()
    arr = LIST(n)
    for i in range(n): arr[i] = input()
    return arr
def MIT(n=None,m=None): # input transposed matrix/array of integers
    if n is None: n,m = VI()
    a = MI(n,m)
    arr = LIST(m,n)
    for i,l in enumerate(a):
        for j,x in enumerate(l):
            arr[j][i] = x
    return arr



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



def __starting_point():
    main()

__starting_point()

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

n = int(input())
a = [list(input()) for i in range(n)]

Max = 0
for i in a:
	cnt = 0
	for j in a:
		if i == j:
			cnt += 1
	Max = max(cnt, Max)
print(Max)

def func(x):
    pass

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

__starting_point()

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

__author__ = 'taras-sereda'
from collections import Counter

def b():
    n = int(input())

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

def __starting_point():
    print(b())

__starting_point()

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

__author__ = 'Andrey'


def count_clean():
    nonlocal room
    nonlocal n
    c = 0
    for row in room:
        if sum(row) == n:
            c += 1
    return c


def invert(row):
    nonlocal room
    nonlocal n
    cleaned = []
    for i in range(n):
        if room[row][i] == 0:
            for j in range(n):
                room[j][i] = 1 - room[j][i]
            cleaned.append(i)
    c = count_clean()
    for w in cleaned:
        for j in range(n):
                room[j][w] = 1 - room[j][w]
    return c

room = []
m = 0
n = int(input())
for q in range(n):
    room.append(list(map(int, list(input()))))
for i in range(n):
    m = max(invert(i), m)
print(m)