Bob has made a list of
As a result, he has made a list of
Wanting to have as many resolutions as possible, can you determine the maximum number of resolutions he can keep in his original list?
Constraints
For this problem, you will be required to pass all the samples in order to receive any points. However, you are NOT required to pass all previous subtasks to receive points for a specific subtask.
Each restriction will only be stated once. Note that the restriction
Subtask 1 [5/15]
Subtask 2 [7/15]
Subtask 3 [3/15]
No additional constraints.
Input Specification
The first line will contain
The next
Output Specification
Output one integer on one line, the maximum number of resolutions he can keep in his original list.
Sample Input
4 2
1 2
3 2
Sample Output
3
Explanation
Bob should remove resolution
Comments