Bob has made a list of new year's resolutions, numbered from to . Upon closer inspection, however, he notices some resolutions contradict each other!
As a result, he has made a list of restrictions, each of which is a pair stating that if Bob fulfills the -th resolution, he cannot fulfill the -th resolution, and vice versa.
Wanting to have as many resolutions as possible, can you determine the maximum number of resolutions he can keep in his original list?
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 is the same as the restriction .
Subtask 1 [5/15]
Subtask 2 [7/15]
Subtask 3 [3/15]
No additional constraints.
The first line will contain integers and .
The next lines will contain integers and .
Output one integer on one line, the maximum number of resolutions he can keep in his original list.
4 2 1 2 3 2
Bob should remove resolution and keep the rest of the resolutions.