import scala.collection.mutable.Queue

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val e = List.fill(m)((sc.nextInt()-1, sc.nextInt()-1))

  def isConnected(s: Int, t: Int, n: Int, edges: Seq[(Int, Int)]): Boolean = {
    val adj = Array.fill(n)(List[Int]())
    for ((u,v) <- edges if (u, v) != (s, t)) {
      adj(u) ::= v
      adj(v) ::= u
    }

    val visited = Array.fill(n)(false)
    visited(s) = true
    val queue = Queue(s)
    while (!visited(t) && queue.nonEmpty) {
      val u = queue.dequeue()
      for (v <- adj(u) if !visited(v)) {
        visited(v) = true
        queue.enqueue(v)
      }
    }
    visited(t)
  }

  val ans = e.count{case (a, b) => !isConnected(a, b, n, e)}
  println(ans)
}
