import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List
import qualified Data.Graph as G

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n,m] <- getIntList
    edge <- replicateM m $ do
        [a,b] <- getIntList
        return (a,b)
    let es edge = edge ++ map (\(a,b) -> (b,a)) edge
    let ans = length [()| e <- edge, (> 1) . length . G.components $ G.buildG (1,n) (es (delete e edge))]
    print ans