Write a program that reads several data sets from a text file and computes the safety factor for the cable networks encoded by the data sets. Each data set starts with two integers: 0 ≤ n ≤ 50, the number of relays in the net, and m, the number of cables in the net. Follow m data pairs (u, v), u < v, where u and v are relay identifiers (integers in the range 0 . . . n − 1). The pair (u, v) designates the cable that interconnects the relays u and v. The pairs may occur in any order. Except the (u, v) pairs, which do not contain white spaces, white spaces can occur freely in input. Input data terminate with an end of file and are correct.
For each data set, the program prints on the standard output, from the beginning of a line, the safety factor of the encoded net. Note about the sample: The first data set encodes an empty network, the second data set corresponds to a network with a single relay, and the following three data sets encode the nets shown in figure 1.