local n, m = io.read("*n", "*n")
local t = {}
local as, bs = {}, {}
for i = 1, n do t[i] = {} end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  as[i], bs[i] = a, b
  t[a][b], t[b][a] = true, true
end

local function check(tbl)
  local reached = {true}
  for i = 2, n do reached[i] = false end
  local reachnum = 1
  local tasks = {1}
  local tasknum, done = 1, 0
  while done < tasknum do
    done = done + 1
    local idx = tasks[done]
    for k, v in pairs(tbl[idx]) do
      if v and not reached[k] then
        table.insert(tasks, k)
        reached[k] = true
        reachnum = reachnum + 1
        tasknum = tasknum + 1
      end
    end
  end
  return n == reachnum
end
local ret = 0
for i = 1, m do
  t[as[i]][bs[i]], t[bs[i]][as[i]] = false, false
  if not check(t) then ret = ret + 1 end
  t[as[i]][bs[i]], t[bs[i]][as[i]] = true, true
end
print(ret)
