favorite We need a little bit of your help to keep things running, click on this banner to learn more

Graph representation

Number of hanging vertices 2

Given a simple undirected unweighted graph. Count the number of hanging vertices in it. The vertex is hanging, if its degree is 1.


The first line contains two numbers n and m (1n, m1000) - the number of vertices and the number of edges. Next m lines contain a list of edges.


Print the number of hanging vertices in a graph.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 1
1 2
Output example #1
Input example #2
3 3
1 2
1 3
2 3
Output example #2