Friendship
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Friendship
Time limit: 1 seconds
Memory limit: 512 megabytes
Problem Statement
The friend-ship usually sinks easily.
There are students lining up from west to east and between the -th student and the -th student there is a friendship chain at first.
We define if -th student and -th student are not friends, if and only if there exists no friendship chain between the -th student and the -th student. It is clear that all the students are friends in the beginning.
One day, fights took place among these students. Here we define fight as follows:
A fight took place between only two students, the -th student and -th student, so -th student and -th student are not friends any more.
To meet all these fights you need to break some friendship chains. Print the minimum number of friendship chains that must be broken.
Input
The first line contains two integers denoting the number of students and fights.
In the following lines, each line contains two integers denoting the -th fight between the -th students and the -th student. It is guaranteed that all pairs are distinct.
Output
Print a single integer, denoting the answer to the question.
5 2
1 3
2 5
1
Notes
The requests can be met only by breaking the friendship chain between the second student and the third student.