ADACHERY  Ada and Cherry
As you might already know, Ada the Ladybug is a farmer. She grows cherry and now she wants to collect them. She is wondering about the number of cherries she will collect. But befor you could help here, you shall know some biological facts:
Firstly, almost everyone think that cherrytree is a tree. But it might not be true  in fact, it is a graph.
Secondly, you have to know, how a cherry looks like. It is not hard to recognize a chery  it is a node, which is connected to another two nodes, which are NOT connected.
NOTE: Even though the cherrytree structure might be weird, note that there won't be any multibranches nor selfbranches. Anyway do not assume it is not a cherryforest.
This is a cherry:
This is NOT a cherry:
Input
The first line contains two integers 1 ≤ N, M ≤ 10^{5}, the number of nodes of cherrytree and the number of branches (edges) connecting them.
The next M lines contains two integers 0 ≤ a, b < N, the branch connecting two nodes.
Output
Print a single line  the number of cherries on the cherrytree.
Example Input
4 2 1 2 3 2
Example Output
1
Example Input 2
5 4 1 2 1 3 1 4 1 0
Example Output 2
6
Example Input 3
6 6 0 1 0 2 2 1 0 3 1 4 5 3
Example Output 3
5
hide comments
julkas:
20190511 12:49:58
@pawanrocks


pawanrocks:
20190510 15:09:11
Can somebody please explain how the example output 3 is 5. 

julkas:
20171112 14:07:11
Classic problem. 
Added by:  Morass 
Date:  20170725 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 