import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.container;
import std.array;
import std.math;
import std.range;
import std.typecons;
import std.ascii;
import std.format;

void main()
{
  auto input = readln.chomp.split.map!(to!int);
  auto n = input[0];
  auto m = input[1];
  int[] as;
  int[] bs;
  foreach (i; 0..m) {
    auto ab = readln.chomp.split.map!(to!int);
    as ~= ab.front;
    bs ~= ab.back;
  }
  int cnt = 0;
  foreach (i; 0..m) { // skip i
    bool[] done = new bool[n + 1];
    int[] queue = [1];
    while (queue.length) {
      int node = queue.front;
      queue.popFront;
      if (done[node]) {
        continue;
      }
      done[node] |= true;
      foreach (j; 0..m) {
        if (i == j) {
          continue;
        }
        if (as[j] == node) {
          queue ~= bs[j];
        }
        if (bs[j] == node) {
          queue ~= as[j];
        }
      }
    }
    bool flag = true;
    for (int j = 1; j <= n; ++j) {
      flag &= done[j];
    }
    cnt += !flag;
  }
  cnt.writeln;
}
