import numpy as np



def main():

    A = np.loadtxt(open(0), np.int64, skiprows=1, ndmin=2)



    N = ans = len(A)



    while A.any():

        b = np.bincount(A[:, 0])

        A = np.reshape(A[A != np.argmax(b)], (N, -1))

        ans = min(ans, max(b))



    print(ans)





if __name__ == '__main__':

    main()

import numpy as np



def main():

    A = np.loadtxt(open(0), np.int32, skiprows=1, ndmin=2)



    N = ans = len(A)



    while A.any():

        b = np.bincount(A[:, 0])

        A = np.reshape(A[A != np.argmax(b)], (N, -1))

        ans = min(ans, max(b))



    print(ans)





if __name__ == '__main__':

    main()

import numpy as np


def main():
    A = np.loadtxt(open(0), np.int64, skiprows=1, ndmin=2)
    N = ans = len(A)
    while A.any():
        b = np.bincount(A[:, 0])
        A = np.reshape(A[A != np.argmax(b)], (N, -1))
        ans = min(ans, max(b))
    print(ans)


if __name__ == "__main__":
    main()

import numpy as np


def main():
    A = np.loadtxt(open(0), np.int32, skiprows=1, ndmin=2)
    N = ans = len(A)
    while A.any():
        b = np.bincount(A[:, 0])
        A = np.reshape(A[A != np.argmax(b)], (N, -1))
        ans = min(ans, max(b))
    print(ans)


if __name__ == "__main__":
    main()

-    A = np.loadtxt(open(0), np.int64, skiprows=1, ndmin=2) +    A = np.loadtxt(open(0), np.int32, skiprows=1, ndmin=2)