let () =
  Scanf.scanf "%d %d" @@ fun n m ->
  let edges = Array.init m (fun _ -> Scanf.scanf " %d %d" (fun a b -> a-1, b-1)) in
  let g = Array.init n (fun _ -> Array.make n false) in
  edges |> Array.iter (fun (u, v) ->
    g.(u).(v) <- true; g.(v).(u) <- true);
  let check () =
    let visited = Array.make n false in
    let rec dfs v =
      visited.(v) <- true;
      Array.mapi (fun w e -> if e && not visited.(w) then dfs w else 0) g.(v)
      |> Array.fold_left (+) 1
    in dfs 0 < n
  in
  edges |> Array.map (fun (u, v) ->
    g.(u).(v) <- false; g.(v).(u) <- false;
    let x = if check () then 1 else 0 in
    g.(u).(v) <- true; g.(v).(u) <- true;
    x)
  |> Array.fold_left (+) 0
  |> Printf.printf "%d\n"