import numpy as np

import sys 



N, M = list(map(int, input().split()))

AB = np.array(sys.stdin.read().split(), np.int64)

A = AB[::2]

B = AB[1::2]

E = np.zeros([N+1, N+1], np.int64)



np.add.at(E,(A,B),1)

np.add.at(E,(B,A),1)



def dfs(E):

	flg = np.zeros(1+N)

	flg[0] = 0

	q = [1]



	while q:

		cp = q.pop()

		flg[cp] = 1



		for n in range(1,N+1):

			if flg[n] == 0 and E[cp][n] == 1:

				flg[n] = 1

				q.append(n)



	if flg.sum() == N:

		return 0

	else:

		return 1



ans = 0

for i in range(1,N+1):

	for j in range(i+1,N+1):

		if E[i,j] == 0:

			continue



		E[i,j] = 0

		E[j,i] = 0



		ans += dfs(E)



		E[i,j] = 1

		E[j,i] = 1



print(ans)
import numpy as np

import sys



class UnionFind:

	def __init__(self, n):

		self.n = n

		self.root = [-1]*(n+1)

		self.rnk = [0]*(n+1)

		self.Maxroot = -1



	def Find_Root(self, x):

		if (self.root[x] < 0):

			return x

		else:

			self.root[x] = self.Find_Root(self.root[x])

			return self.root[x]



	def Unite(self, x, y):

		x = self.Find_Root(x)

		y = self.Find_Root(y)

		if x == y:

			return 

		elif self.rnk[x] > self.rnk[y]:

			self.root[x] += self.root[y]

			if self.root[x] < self.Maxroot:

				self.Maxroot = self.root[x]

			self.root[y] = x

		else:

			self.root[y] += self.root[x]

			if self.root[y] < self.Maxroot:

				self.Maxroot = self.root[y]

			self.root[x] = y

			if self.rnk[x] == self.rnk[y]:

				self.rnk[y] += 1



	def isSameGroup(self, x, y):

		return self.Find_Root(x) == self.Find_Root(y)



	def Count(self, x):

		return self.root[self.Find_Root(x)] * (-1)



	def Max_tree(self):

		return min(self.root) * (-1)



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

AB = np.array(sys.stdin.read().split(), np.int64)

A = AB[::2]

B = AB[1::2]



ans = 0

for i in range(m):

	solve = UnionFind(n+1)

	for j in range(m):

		if j == i:

			continue

		

		solve.Unite(A[j],B[j])



	if solve.Max_tree() != n:

		ans += 1



print(ans)



import numpy as np
import sys

N, M = list(map(int, input().split()))
AB = np.array(sys.stdin.read().split(), np.int64)
A = AB[::2]
B = AB[1::2]
E = np.zeros([N + 1, N + 1], np.int64)
np.add.at(E, (A, B), 1)
np.add.at(E, (B, A), 1)


def dfs(E):
    flg = np.zeros(1 + N)
    flg[0] = 0
    q = [1]
    while q:
        cp = q.pop()
        flg[cp] = 1
        for n in range(1, N + 1):
            if flg[n] == 0 and E[cp][n] == 1:
                flg[n] = 1
                q.append(n)
    if flg.sum() == N:
        return 0
    else:
        return 1


ans = 0
for i in range(1, N + 1):
    for j in range(i + 1, N + 1):
        if E[i, j] == 0:
            continue
        E[i, j] = 0
        E[j, i] = 0
        ans += dfs(E)
        E[i, j] = 1
        E[j, i] = 1
print(ans)

import numpy as np
import sys


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rnk = [0] * (n + 1)
        self.Maxroot = -1

    def Find_Root(self, x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]

    def Unite(self, x, y):
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        if x == y:
            return
        elif self.rnk[x] > self.rnk[y]:
            self.root[x] += self.root[y]
            if self.root[x] < self.Maxroot:
                self.Maxroot = self.root[x]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            if self.root[y] < self.Maxroot:
                self.Maxroot = self.root[y]
            self.root[x] = y
            if self.rnk[x] == self.rnk[y]:
                self.rnk[y] += 1

    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    def Count(self, x):
        return self.root[self.Find_Root(x)] * (-1)

    def Max_tree(self):
        return min(self.root) * (-1)


n, m = list(map(int, input().split()))
AB = np.array(sys.stdin.read().split(), np.int64)
A = AB[::2]
B = AB[1::2]
ans = 0
for i in range(m):
    solve = UnionFind(n + 1)
    for j in range(m):
        if j == i:
            continue
        solve.Unite(A[j], B[j])
    if solve.Max_tree() != n:
        ans += 1
print(ans)

-N, M = list(map(int, input().split())) + +class UnionFind: +    def __init__(self, n): +        self.n = n +        self.root = [-1] * (n + 1) +        self.rnk = [0] * (n + 1) +        self.Maxroot = -1 + +    def Find_Root(self, x): +        if self.root[x] < 0: +            return x +        else: +            self.root[x] = self.Find_Root(self.root[x]) +            return self.root[x] + +    def Unite(self, x, y): +        x = self.Find_Root(x) +        y = self.Find_Root(y) +        if x == y: +            return +        elif self.rnk[x] > self.rnk[y]: +            self.root[x] += self.root[y] +            if self.root[x] < self.Maxroot: +                self.Maxroot = self.root[x] +            self.root[y] = x +        else: +            self.root[y] += self.root[x] +            if self.root[y] < self.Maxroot: +                self.Maxroot = self.root[y] +            self.root[x] = y +            if self.rnk[x] == self.rnk[y]: +                self.rnk[y] += 1 + +    def isSameGroup(self, x, y): +        return self.Find_Root(x) == self.Find_Root(y) + +    def Count(self, x): +        return self.root[self.Find_Root(x)] * (-1) + +    def Max_tree(self): +        return min(self.root) * (-1) + + +n, m = list(map(int, input().split())) -E = np.zeros([N + 1, N + 1], np.int64) -np.add.at(E, (A, B), 1) -np.add.at(E, (B, A), 1) - - -def dfs(E): -    flg = np.zeros(1 + N) -    flg[0] = 0 -    q = [1] -    while q: -        cp = q.pop() -        flg[cp] = 1 -        for n in range(1, N + 1): -            if flg[n] == 0 and E[cp][n] == 1: -                flg[n] = 1 -                q.append(n) -    if flg.sum() == N: -        return 0 -    else: -        return 1 - - -for i in range(1, N + 1): -    for j in range(i + 1, N + 1): -        if E[i, j] == 0: +for i in range(m): +    solve = UnionFind(n + 1) +    for j in range(m): +        if j == i: -        E[i, j] = 0 -        E[j, i] = 0 -        ans += dfs(E) -        E[i, j] = 1 -        E[j, i] = 1 +        solve.Unite(A[j], B[j]) +    if solve.Max_tree() != n: +        ans += 1