#include <bits/stdc++.h>
using namespace std;
const int limit = 50;
int n, m;
int a[limit], b[limit];
bool g[limit][limit];
bool visited[limit];
void dfs(int v) {
  visited[v] = true;
  for (int v2 = 0; v2 < n; v2++) {
    if (g[v][v2] == false) continue;
    if (visited[v2] == true) continue;
    dfs(v2);
  }
}
int main(void) {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    g[a[i]][b[i]] = g[b[i]][a[i]] = true;
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    g[a[i]][b[i]] = g[b[i]][a[i]] = false;
    for (int j = 0; j < n; j++) visited[j] = false;
    dfs(0);
    bool bridge = false;
    for (int j = 0; j < n; j++) {
      if (visited[j] == false) bridge = true;
    }
    if (bridge) ans++;
    g[a[i]][b[i]] = g[b[i]][a[i]] = true;
  }
  cout << ans << endl;
  return 0;
}
