import sys

from io import StringIO

import unittest



sys.setrecursionlimit(10**5)



def dfs(u, visited, g, seq):

	visited[u] = True

	for v in g[u]:

		if visited[v] == True or not seq[u][v]:

			continue

		dfs(v, visited, g, seq)



def resolve():

	n, m = list(map(int, input().split()))

	seq = [[True]*n for _ in range(n)]

	g = [[] for _ in range(n)]

	edges = []

	ans = 0

	for _ in range(m):

		a, b = list(map(int, input().split()))

		edges.append([a-1, b-1])

	for i in range(m):

		g[edges[i][0]].append(edges[i][1])

		g[edges[i][1]].append(edges[i][0])



	for i in range(m):

		visited = [False]*n



		seq[edges[i][1]][edges[i][0]] = False

		seq[edges[i][0]][edges[i][1]] = False



		dfs(0, visited, g, seq)

		if len(visited) != visited.count(True):

			ans += 1

		seq[edges[i][1]][edges[i][0]] = True

		seq[edges[i][0]][edges[i][1]] = True

	print(ans)

resolve()
def search(u, g, visited):

	if visited[u]:

		return

	visited[u] = True

	for v in g[u]:

		search(v, g, visited)



def resolve():

	n, m = list(map(int, input().split()))

	edges = [list(map(int, input().split())) for _ in range(m)]

	ans = 0

	for i in range(m):

		g = [[] for _ in range(n)]

		for j in range(m):

			if i == j:

				continue

			a, b = edges[j]

			g[a-1].append(b-1)

			g[b-1].append(a-1)

		visited = [False]*n

		search(0, g, visited)

		if visited.count(True) != n:

			ans += 1

	print(ans)

resolve()
import sys
from io import StringIO
import unittest

sys.setrecursionlimit(10**5)


def dfs(u, visited, g, seq):
    visited[u] = True
    for v in g[u]:
        if visited[v] == True or not seq[u][v]:
            continue
        dfs(v, visited, g, seq)


def resolve():
    n, m = list(map(int, input().split()))
    seq = [[True] * n for _ in range(n)]
    g = [[] for _ in range(n)]
    edges = []
    ans = 0
    for _ in range(m):
        a, b = list(map(int, input().split()))
        edges.append([a - 1, b - 1])
    for i in range(m):
        g[edges[i][0]].append(edges[i][1])
        g[edges[i][1]].append(edges[i][0])
    for i in range(m):
        visited = [False] * n
        seq[edges[i][1]][edges[i][0]] = False
        seq[edges[i][0]][edges[i][1]] = False
        dfs(0, visited, g, seq)
        if len(visited) != visited.count(True):
            ans += 1
        seq[edges[i][1]][edges[i][0]] = True
        seq[edges[i][0]][edges[i][1]] = True
    print(ans)


resolve()

def search(u, g, visited):
    if visited[u]:
        return
    visited[u] = True
    for v in g[u]:
        search(v, g, visited)


def resolve():
    n, m = list(map(int, input().split()))
    edges = [list(map(int, input().split())) for _ in range(m)]
    ans = 0
    for i in range(m):
        g = [[] for _ in range(n)]
        for j in range(m):
            if i == j:
                continue
            a, b = edges[j]
            g[a - 1].append(b - 1)
            g[b - 1].append(a - 1)
        visited = [False] * n
        search(0, g, visited)
        if visited.count(True) != n:
            ans += 1
    print(ans)


resolve()

-import sys -from io import StringIO -import unittest - -sys.setrecursionlimit(10**5) - - -def dfs(u, visited, g, seq): +def search(u, g, visited): +    if visited[u]: +        return -        if visited[v] == True or not seq[u][v]: -            continue -        dfs(v, visited, g, seq) +        search(v, g, visited) -    seq = [[True] * n for _ in range(n)] -    g = [[] for _ in range(n)] -    edges = [] +    edges = [list(map(int, input().split())) for _ in range(m)] -    for _ in range(m): -        a, b = list(map(int, input().split())) -        edges.append([a - 1, b - 1]) -        g[edges[i][0]].append(edges[i][1]) -        g[edges[i][1]].append(edges[i][0]) -    for i in range(m): +        g = [[] for _ in range(n)] +        for j in range(m): +            if i == j: +                continue +            a, b = edges[j] +            g[a - 1].append(b - 1) +            g[b - 1].append(a - 1) -        seq[edges[i][1]][edges[i][0]] = False -        seq[edges[i][0]][edges[i][1]] = False -        dfs(0, visited, g, seq) -        if len(visited) != visited.count(True): +        search(0, g, visited) +        if visited.count(True) != n: -        seq[edges[i][1]][edges[i][0]] = True -        seq[edges[i][0]][edges[i][1]] = True