#include <bits/stdc++.h>
using namespace std;
struct vertex {
  int time_in, min_time, kol;
  bool color;
  vector<int> sosedi;
};
vector<vertex> graph;
int boss;
int timer = 0;
void dfs(int v, int parent = -1) {
  timer++;
  graph[v].time_in = graph[v].min_time = timer;
  graph[v].color = true;
  for (int i = 0; i < graph[v].sosedi.size(); i++) {
    int p = graph[v].sosedi[i];
    if (!graph[p].color) {
      dfs(p, v);
      boss = max(boss, graph[v].kol + graph[p].kol +
                           (graph[p].min_time > graph[v].time_in));
      graph[v].kol = max(graph[v].kol,
                         graph[p].kol + (graph[p].min_time > graph[v].time_in));
      graph[v].min_time = min(graph[v].min_time, graph[p].min_time);
    } else if (p != parent)
      graph[v].min_time = min(graph[p].min_time, graph[v].min_time);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  graph.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a - 1].sosedi.push_back(b - 1);
    graph[b - 1].sosedi.push_back(a - 1);
  }
  for (int i = 0; i < n; i++) {
    graph[i].color = false;
    graph[i].kol = 0;
  }
  dfs(0);
  cout << boss;
  return 0;
}
