// url: http://abc075.contest.atcoder.jp/tasks/abc075_c

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto rd1 = readln.split.to!(size_t[]), n = rd1[0], m = rd1[1];

  struct Edge { size_t a, b; }
  auto e = new Edge[](m);
  foreach (i; 0..m) {
    auto rd2 = readln.split.to!(size_t[]), ai = rd2[0]-1, bi = rd2[1]-1;
    e[i] = Edge(ai, bi);
  }

  auto ans = 0;
  foreach (i; 0..m) {
    auto uf = UnionFind(n);
    foreach (j; 0..m)
      if (i != j) uf.unite(e[j].a, e[j].b);
    if (uf.countForests > 1) ++ans;
  }

  writeln(ans);
}

struct UnionFind
{
  import std.algorithm, std.range;

  size_t[] p; // parent
  const size_t s; // sentinel
  const size_t n;
  size_t countForests; // number of forests
  size_t[] countNodes; // number of nodes in forests

  this(size_t n)
  {
    this.n = n;
    s = n;
    p = new size_t[](n);
    p[] = s;
    countForests = n;
    countNodes = new size_t[](n);
    countNodes[] = 1;
  }

  size_t opIndex(size_t i)
  {
    if (p[i] == s) {
      return i;
    } else {
      p[i] = this[p[i]];
      return p[i];
    }
  }

  bool unite(size_t i, size_t j)
  {
    auto pi = this[i], pj = this[j];
    if (pi != pj) {
      p[pj] = pi;
      --countForests;
      countNodes[pi] += countNodes[pj];
      return true;
    } else {
      return false;
    }
  }

  auto countNodesOf(size_t i) { return countNodes[this[i]]; }
  bool isSame(size_t i, size_t j) { return this[i] == this[j]; }

  auto groups()
  {
    auto g = new size_t[][](n);
    foreach (i; 0..n) g[this[i]] ~= i;
    return g.filter!(l => !l.empty);
  }
}
