Problem C
Entertainment Box

Ada, Bertrand and Charles often argue over which TV shows to
watch, and to avoid some of their fights they have finally
decided to buy a video tape recorder. This fabulous, new device
can record
The three friends wonder how many TV shows they can record during one day. They provide you with the TV guide for today’s shows, and tell you the number of shows the machine can record simultaneously. How many shows can they record, using their recording machine? Count only shows that are recorded in their entirety.
Input
The first line of input contains two integers
Output
The output should contain exactly one line with a single integer: the maximum number of full shows from the TV guide that can be recorded with the tape recorder.
Sample Input 1 | Sample Output 1 |
---|---|
3 1 1 2 2 3 2 3 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
4 1 1 3 4 6 7 8 2 5 |
3 |
Sample Input 3 | Sample Output 3 |
---|---|
5 2 1 4 5 9 2 7 3 8 6 10 |
3 |