import std.functional,
       std.algorithm,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void dfs(bool[][] dp, bool[] visited, int v) {
  visited[v] = true;

  foreach (int i, e; dp[v]) {
    if (e) {
      if (!visited[i]) {
        dfs(dp, visited, i);
      }
    }
  }
}

void main() {
  int[] NM = readln.chomp.split.to!(int[]);
  int N = NM[0],
      M = NM[1];
  bool[][] dp;
  dp.length = N;
  foreach (ref e; dp) {
    e.length = N;
  }
  int[][] vs;
  int ans;

  foreach (_; 0..M) {
    int[] ab = readln.chomp.split.to!(int[]);
    int a = ab[0],
        b = ab[1];
    a--;
    b--;
    vs ~= [a, b];
    dp[a][b] = dp[b][a] = true;
  }

  foreach (v; vs) {
    int a = v[0],
        b = v[1];
    bool[] visited;
    visited.length = N;

    dp[a][b] = dp[b][a] = false;

    dfs(dp, visited, 0);

    if (!visited.all!(e => e)) {
      ans++;
    }

    dp[a][b] = dp[b][a] = true;
  }

  writeln(ans);
}
