import           Data.Graph.Inductive

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
    [n, m] <- readInts
    abs <- sequence $ replicate m readInts
    print $ solve n abs

solve :: Int -> [[Int]] -> Int
solve n abs = length $ filter (not . isConnected) [ delEdge e gr | e <- es ]
  where
    vs = [1..n]
    es = [ (a, b) | [a, b] <- abs ]
    gr = mkUGraph vs es :: Gr () ()
