{-# LANGUAGE FlexibleContexts #-}
import Control.Applicative
import Control.Monad.ST
import Control.Monad
import Control.Monad.State
import Control.Monad.List
import Data.Array.ST
import Data.STRef
import Data.List
import Data.Tuple
import Data.Maybe
import Debug.Trace

modifyArray arr i f = readArray arr i >>= \x -> writeArray arr i (f x)
listToTuple2 [a,b] = (a,b)

bridge n edges = runST $ do
  ord <- newArray (1,n) (-1) :: ST s (STArray s Int Int)
  low <- newArray (1,n) (-1) :: ST s (STArray s Int Int)

  order <- newSTRef 0 :: ST s (STRef s Int)
  
  let
    dfs cur par order es = do
      let (connected, others) = partition ((==cur) . fst) es
      readSTRef order >>= \x -> writeArray ord cur x >> writeArray low cur x
      modifySTRef order (+1)
      
      forM_ connected $ \(_,next) -> do
        nextOrder <- readArray ord next
        when (next /= par) $ do
          if nextOrder == -1 then do
            dfs next cur order others
            readArray low next >>= \x -> modifyArray low cur (\y -> min y x)
            else
            readArray ord next >>= \x -> modifyArray low cur (\y -> min y x)

  dfs 1 (-1) order edges

  res <- forM edges $ \(u,v) -> do
    a <- readArray ord u
    b <- readArray low v
    return $ if a<b then Just (u,v) else Nothing
  return $ catMaybes res

main = do
  (n,m) <- listToTuple2 . map read . words <$> getLine :: IO (Int,Int)
  edges <- map (listToTuple2 . map read . words) . lines <$> getContents :: IO [(Int,Int)]

  print $ length $ bridge n (edges ++ (map swap edges))
