import scala.util.control.Breaks

object Main{
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val M = sc.nextInt

    val as = Array.ofDim[Int](M)
    val bs = Array.ofDim[Int](M)

    for(i <- 0 to M-1){
      val a = sc.nextInt-1
      val b = sc.nextInt-1

      as(i) = a
      bs(i) = b
    }
    //println(as.deep)
    //println(bs.deep)

    var ans = 0
    for(ii <- 0 to M-1){
      val a = as(ii)
      val b = bs(ii)

      val d:Array[Array[Int]] = Array.fill(N,N)(1000)
      //println("...." + ii)
      for(j <- 0 to N-1){
        //println(j)
        d(j)(j) = 0
        //println(j)
      }
      for(j <- 0 to M-1) d(as(j))(bs(j)) = 1
      for(j <- 0 to M-1) d(bs(j))(as(j)) = 1
      d(a)(b) = 1000
      d(b)(a) = 1000

      //println("-------------------------------")
      //d.foreach(inp => println(inp.deep))


      for(k <- 0 to N-1){
        for(i <- 0 to N-1){
          for(j <- 0 to N-1){
            if(d(i)(j) > d(i)(k) + d(k)(j)) d(i)(j) = d(i)(k) + d(k)(j)
          }
        }
      }

      var f = false
      for(i <- 0 to N-1) for(j <- i+1 to N-1) if(d(i)(j) >= 1000) f=true
      if(f) ans = ans + 1
      //println(f)
      //d.foreach(inp => println(inp.deep))
    }
    println(ans)
  }
}
