fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
class UnionFind(n: Int) {
    val v = Array(n) {
        -1
    }

    fun unite(a: Int, b: Int) {
        val ar = find(a)
        val br = find(b)
        if (ar == br) {
            return
        }
        if (v[ar] > v[br]) {
            v[br] += v[ar]
            v[ar] = br
        } else {
            v[ar] += v[br]
            v[br] = ar
        }
    }

    fun find(i: Int): Int {
        if (v[i] < 0) {
            return i
        }
        v[i] = find(v[i])
        return v[i]
    }

    fun same(a: Int, b: Int): Boolean {
        return find(a) == find(b)
    }

    fun size(i: Int): Int {
        return -v[find(i)]
    }
}

fun main() {
    val (n, m) = intList()
    val v = mutableListOf<Pair<Int, Int>>()
    repeat(m) {
        val (a, b) = intList()
        v.add(Pair(a, b))
    }
    var c = 0
    repeat(m) { i ->
        val friends = Array(n + 1) { 0 }
        val unionFind = UnionFind(n + 1)
        lateinit var removed: Pair<Int, Int>
        0.until(m).forEach { j ->
            if (i != j) {
                val (a, b) = v[j]
                friends[a]++
                friends[b]++
                unionFind.unite(a, b)
            } else {
                removed = v[j]
            }
        }
        if (!unionFind.same(removed.first, removed.second)) {
            c++
        }
    }
    println(c.toString())
}
