X-Mansion

0

0 votes
Medium
Problem

X-Mansion is the base of operations and the training site for the X-Men. It is also a school for the mutant students, but today, the mutants are having a day off and decided to host a cooking competition. Each participating mutant is allowed to pick up only 10 ingredients. The ingredients are numbered from 100 to 999.

Since picking up grocery and ingredients for so many mutants is a hefty task, Jean decided to award bonus points to any and all mutants who choose the most popular set of ingredients. The popularity of a set is determined by the number of mutants who select exactly the same set of ingredients.

Your task is to calculate the number of mutants who will get these bonus points.

INPUT
The input contains several test cases. The frst line of each test case contains a positive integer N – denoting the number of mutants participating in the competition. Each of the next N lines contain an array A denoted by 10 space separated integers indicating the serial number of the ingredient selected.

CONSTRAINTS
1 <= N <= 104
100 <= Ai <= 999

OUTPUT
For each test case, in a single line print the total number of mutants who get the bonus points for selecting the most popular set of ingredients.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In Test Case 1, mutant 1 and mutant 3 selected the same set of ingredients, making that set most popular and hence these 2 mutants were awared the bonus points.

In Test Case 2, all 3 mutants select diferent set of ingredients and hence the popularity of each set is same and also the maximum i.e 1. So all 3 mutants are awarded bonus points

Editor Image

?