Relays
Sonya has been tasked with organizing a relay race for first graders. The students will be divided into two teams: one for boys and one for girls. Importantly, each team must have the same number of participants. The key objective is to determine the event's success level.
The success level is defined as the maximum number of participants that can be included in one of the teams.
Sonya wants to quickly determine the success level so she can move on to solving programming problems, and she needs your assistance.
Input
The first line contains a single integer ()—the number of first graders.
The second line contains integers ()—where indicates the -th student is a boy, and indicates a girl.
Output
Output a single number representing the maximum success level.
Examples
Note
In the first example, you can select the first, fifth, and sixth boys for the boys' team, and the second, fourth, and seventh girls for the girls' team. The third student can replace any of them.
In the second example, the first and third students can be on the boys' team, although any of the other four boys could replace them, and the fifth and sixth students can be on the girls' team.