题目描述
Codeland is an country that started with N distinct islands, namely islands 1, 2, ..., N. But over time, the armies of some of these islands have taken over other ones. Each takeover occurred when the army of island x invaded island y. After each invasion, all of island y became part of island x, and island y was renamed as island x.
King Ranjit, leader of Bugland, wants to invade Codeland. To do this, he needs to calculate how many distinct island still remain in Codeland after all the takeovers. Help him with this task.
Input:
The first line contains an integer N, the number of islands that were originally in Codeland.
The second line contains an integer K, denoting the number of takeovers that took place.
Each of the next K lines contains 2 space-separated integers x, y, representing that the army of island x took over that of island y. As a result, island y does not exist anymore and is now renamed as island x. It is guaranteed that island x still exists.
Output:
Output one integer, the number of islands that exist in Codeland.
Constraints:
1 ≤ N ≤ 100000
1 ≤ K ≤ 100000
SAMPLE INPUT
4
2
1 2
4 1
SAMPLE OUTPUT
2
Explanation
Codeland started with island 1, 2, 3, 4. First, island 1 invaded island 2, so island 2 was renamed to island 1. Then, island 4 invaded island 1. So what were at the beginning island 1 and 2 were renamed to island 4. Now, only island 3 and 4 remain, so the answer is 2.
输入格式
见题面
输出格式
见题面