import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import qualified Data.Array as A
import qualified Data.Array.IO as A
import qualified Data.Set as S
import Data.Array.Unboxed ((!))
import Debug.Trace

main :: IO ()
main = do
    [n, m] <- map read . words <$> getLine :: IO [Int]
    edges <- replicateM m ((\[a,b]->(a,b)) . map (fst . fromJust . B.readInt) . B.words <$> B.getLine) :: IO [(Int, Int)]
    print . sum =<< forM [1..n] (\i -> do
        graph <- genGraph n . (\l -> l ++ map (\(a,b)->(b,a)) l) . map snd . filter ((i /=) . fst) $ zip [1..] edges
        let s = bfs graph S.empty 1
        return $ if n /= S.size s then 1 else 0 )

bfs :: A.Array Int [Int] -> S.Set Int -> Int -> S.Set Int
bfs graph already pos = let
    already' = S.insert pos already
    in S.unions $ already' : [bfs graph already' pos'|pos' <- graph!pos, S.notMember pos' already']

genGraph :: Int -> [(Int,Int)] -> IO (A.Array Int [Int])
genGraph n edges = do
    graph <- A.newArray (1,n) [] :: IO (A.IOArray Int [Int])
    forM_ edges $ \(from, to) -> do
        (\es -> A.writeArray graph from (to:es)) =<< A.readArray graph from
    A.listArray (1,n) <$> forM [1..n] (A.readArray graph)
