The sites of a cable network are interconnected by cables such that a cable connects a single pair of distinct sites, and a pair of sites can be connected by several cables. We say that the network is connected if any two sites in the network are directly or indirectly connected; otherwise the network is disconnected. The safety grade $S$ of the network is defined as follows.
For example, consider a network on sites $0, \dots, 4$ whose cables are $(0,1)$ (twice), $(1,3)$, $(2,3)$ (twice), $(0,2)$ and $(2,4)$ (twice). The network stays connected when any single cable is removed, whereas removing cables $(0,2)$ and $(1,3)$ disconnects it; another way to disconnect it is to remove both copies of cable $(2,4)$. Its safety grade is $S = 2$.
Write a program that reads several data sets and computes the safety grade of the cable networks the data sets encode.
Each data set starts with two integers: the number $0 \le n \le 100$ of sites in the network, and the number $0 \le m \le 1000$ of cables. Then follow $m$ data pairs $(u, v)$, with $u < v$, where $u$ and $v$ are site identifiers (integers from $0$ to $n-1$). A pair $(u, v)$ designates a cable that interconnects the sites $u$ and $v$. The pairs may occur in any order. Except for the $(u, v)$ pairs, which do not contain white spaces, white spaces can occur freely in the input. The input terminates at end of file and is always correct.
For each data set, print, from the beginning of a line, the safety grade of the encoded network.
In the sample, the first data set encodes an empty network, the second a network with 2 sites and 1 cable, the third a disconnected network with two sites, and the fourth the five-site network described above.