#!/usr/bin/env python3 import itertools n, m = [int(x) for x in input().split()] adj = [[] for _ in range(n)] edge_list = [] for _ in range(m): a, b = [int(x) for x in input().split()] a -= 1 b -= 1 adj[a].append(b) adj[b].append(a) edge_list.append((min(a, b), max(a, b))) # Find edges you can remove while keeping the graph connected. removed_edges = [] for a, b in edge_list: seen = [True] + [False]*(n-1) stack = [0] while len(stack) != 0: cur = stack.pop() for nb in adj[cur]: if (cur, nb) != (a, b) and (nb, cur) != (a, b): if not seen[nb]: stack.append(nb) seen[nb] = True if all(seen): removed_edges.append((a, b)) adj[a] = [x for x in adj[a] if x != b] adj[b] = [x for x in adj[b] if x != a] root = 0 num_outgoing = [len(adj[i]) - 1 for i in range(n)] num_outgoing[root] += 1 toposort = [x for x in range(n) if num_outgoing[x] == 0] stack = [x for x in range(n) if num_outgoing[x] == 0] parent = [-1]*n while len(stack) > 0: cur = stack.pop() for nb in adj[cur]: if num_outgoing[nb] != 0: parent[cur] = nb num_outgoing[nb] -= 1 if num_outgoing[nb] == 0: stack.append(nb) toposort.append(nb) assert len(toposort) == n assert parent[0] == -1 assert all(parent[x] >= 0 for x in range(1, n)) largest = 0 for l in itertools.product([0, 1], repeat=len(removed_edges)): off_verts = [p[i] for p, i in zip(removed_edges, l)] max_ind_used = [0]*n max_ind_unused = [0]*n for x in toposort: for nb in adj[x]: if nb != parent[x]: max_ind_unused[x] += max(max_ind_used[nb], max_ind_unused[nb]) if x not in off_verts: max_ind_used[x] = 1 for nb in adj[x]: if nb != parent[x]: max_ind_used[x] += max_ind_unused[nb] else: max_ind_used[x] = max_ind_unused[x] largest = max(largest, max_ind_used[0], max_ind_unused[0]) print(largest)