Restaurants#8351

Restaurants

1 second
128 megabytes
Easy

In a certain city there is a restaurant network that has a total of almost identical halls. The administration received applications for holding corporate events on a pre-holiday day. Each application specifies the start and end time (from 00:00 to 23:59). To carry out one event, one entire hall is needed (which one exactly doesn't matter). After the end of the event, you need at least half an hour to prepare for the next event in this room. It is required to satisfy as many applications as possible. If you can satisfy all, then the smallest number of halls should be used.

Input

First line contains the numbers and (1 \leq n, k \leq 100). Each of the next lines contains the starting and ending time of application in the form \mathrm{HH:MM-HH:MM}. The end time of each application is at least one minute longer than the start time.

Output

Print in one line two numbers - the number of applications that can be satisfied and the number of halls to use.

Examples

Example 1

Loading
Loading