#include <bits/stdc++.h>
using namespace std;
int adj[101][101];
int num[101];
int ch[101];
int main() {
  int n, m, i, a, b, j;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    adj[a][b] = 1;
    adj[b][a] = 1;
    num[a]++;
    num[b]++;
  }
  int r = 0, c;
  while (1) {
    memset(ch, 0, sizeof(ch));
    c = 0;
    for (i = 1; i <= n; i++)
      if (num[i] == 1) {
        num[i] = 0;
        for (j = 1; j <= n; j++)
          if (adj[i][j]) {
            ch[j]++;
          }
        c = 1;
      }
    for (j = 1; j <= n; j++)
      if (ch[j]) num[j] -= ch[j];
    if (c)
      r++;
    else
      break;
  }
  cout << r;
  return 0;
}
