module Main where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.List
import qualified Text.Printf
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BC

------------------------------------------

import Debug.Trace

main :: IO ()
main = do
  [n, m] <- readInts
  g <- replicateM m $ readInts >>= (\[x, y] -> return (x-1, y-1))
  let gs = remove1 g
      remove1 [] = []
      remove1 (x:xs) = xs : map (x:) (remove1 xs)
  print $ length (filter (not . connected n) gs)

connected :: Int -> [(Int, Int)] -> Bool
connected n g = let visited = loop (True : replicate (n-1) False)
                 in all id visited
  where loop visited =
          let visited' = flip map [0..n-1] $ \w ->
                flip any g $ \(a, b) -> w `elem` [a, b] && (visited !! a || visited !! b)
          in if visited == visited' then visited else loop visited'



------------------------------------------

{- Int input -}

parseInt :: BC.ByteString -> Int
parseInt = fst . fromJust . BC.readInt

parseInts :: BC.ByteString -> [Int]
parseInts = map parseInt <$> BC.words

readInt :: IO Int
readInt = parseInt <$> BC.getLine

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

{- Double Formatting -}

doubleFmt :: Double -> String
doubleFmt = Text.Printf.printf "%.12f"