{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)
import qualified Data.Graph as G
import Data.List (delete)

main :: IO ()
main = do
  [n, m] <- getInts
  abs <- getIntss
  print $ solve n m abs

solve :: Int -> Int -> [[Int]] -> Int
solve n m abs = length $ filter (not . isBridge) abs where
  isBridge [a, b] = G.path g a b where
    g = G.buildG (1, n) es
    es = twin $ delete [a, b] abs

twin :: [[Int]] -> [(Int, Int)]
twin = concatMap $ \[a, b] -> [(a, b), (b, a)]

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine

getIntss :: IO [[Int]]
getIntss = map readInts . BC.lines <$> BC.getContents
