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.
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.
#!/usr/bin/env python
# 554B_clean.py - Codeforces.com 554B Clean quiz
#
# Copyright (C) 2015 Sergey
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
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 column 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.
"""

# Standard libraries
import unittest
import sys
import re

# Additional libraries


###############################################################################
# Clean Class
###############################################################################


class Clean:
    """ Clean representation """

    def __init__(self, args):
        """ Default constructor """

        self.args = args
        self.list = args

    def r2dec(self, row):
        """ Convert row into decimal """
        return int(self.list[row], 2)

    def calculate(self):
        """ Main calcualtion function of the class """

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

###############################################################################
# Executable code
###############################################################################


def decode_inputs(inputs):
    """ Decoding input string list into base class args list """

    # Decoding input
    strlist = inputs[1:]

    return strlist


def calculate(inputs):
    """ Base class calculate method wrapper """
    return Clean(decode_inputs(inputs)).calculate()


def main():
    """ Main function. Not called by unit tests """

    # Read test input string list
    num = int(input())
    inputs = [input() for n in range(num)]
    inputs.insert(0, num)

    # Print the result
    print(calculate(inputs))

###############################################################################
# Unit Tests
###############################################################################


class unitTests(unittest.TestCase):

    def test_decode_inputs(self):
        """ Input string decoding testing """
        self.assertEqual(
            decode_inputs(["2", "00", "10"]), ["00", "10"])

    def test_Clean_class__basic_functions(self):
        """ Clean class basic functions testing """
        d = Clean(["00", "11"])
        self.assertEqual(d.list[1], "11")

        # Convert
        self.assertEqual(d.r2dec(1), 3)

    def test_calculate(self):
        """ Main calculation function """

        # Sample tests
        self.assertEqual(
            calculate(["4", "0101", "1000", "1111", "0101"]), 2)
        self.assertEqual(
            calculate(["3", "111", "111", "111"]), 3)


if __name__ == "__main__":
    if sys.argv[-1] == "-ut":
        unittest.main(argv=[" "])
    main()
