class UnionFind():

	def __init__(self, n):

		self.n = n

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

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



	def find(self, x):

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

			return x

		else:

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

			return self.root[x]

			

	def unite(self, x, y):

		x = self.find(x)

		y = self.find(y)

		if(x == y):

			return 0

		elif(self.rank[x] > self.rank[y]):

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

			self.root[y] = x

		else:

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

			self.root[x] = y

			if(self.rank[x] == self.rank[y]):

				self.rank[y] += 1



	def size(self, x):

		return -self.root[self.find(x)]

		

n,m,*l = list(map(int,open(0).read().split()))

edges = [(a,b) for a,b in zip(l[::2],l[1::2])]

ans = 0

for i in range(m):

	uf = UnionFind(n)

	for j in range(m):

		if i==j:

			continue

		else:

			a,b = edges[j]

			uf.unite(a,b)

	ans += uf.size(a)<n

print(ans)
import sys

input = sys.stdin.buffer.readline

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

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

def check(s,t):

	q=[0]

	vis=[0]*n

	vis[0]=1

	while q:

		c=q.pop()

		for x in con[c]:

			if (c==s and x==t) or (c==t and x==s) or vis[x]:

				continue

			vis[x]=1

			q.append(x)

	return not all(vis)

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

for s,t in es:

	con[s-1]+=t-1,

	con[t-1]+=s-1,

print((sum(check(s-1,t-1) for s,t in es)))
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rank = [0] * (n + 1)

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

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return 0
        elif self.rank[x] > self.rank[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1

    def size(self, x):
        return -self.root[self.find(x)]


n, m, *l = list(map(int, open(0).read().split()))
edges = [(a, b) for a, b in zip(l[::2], l[1::2])]
ans = 0
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i == j:
            continue
        else:
            a, b = edges[j]
            uf.unite(a, b)
    ans += uf.size(a) < n
print(ans)

import sys

input = sys.stdin.buffer.readline
n, m = list(map(int, input().split()))
es = [list(map(int, input().split())) for _ in range(m)]


def check(s, t):
    q = [0]
    vis = [0] * n
    vis[0] = 1
    while q:
        c = q.pop()
        for x in con[c]:
            if (c == s and x == t) or (c == t and x == s) or vis[x]:
                continue
            vis[x] = 1
            q.append(x)
    return not all(vis)


con = [[] for _ in range(n)]
for s, t in es:
    con[s - 1] += (t - 1,)
    con[t - 1] += (s - 1,)
print((sum(check(s - 1, t - 1) for s, t in es)))

-class UnionFind: -    def __init__(self, n): -        self.n = n -        self.root = [-1] * (n + 1) -        self.rank = [0] * (n + 1) +import sys -    def find(self, x): -        if self.root[x] < 0: -            return x -        else: -            self.root[x] = self.find(self.root[x]) -            return self.root[x] - -    def unite(self, x, y): -        x = self.find(x) -        y = self.find(y) -        if x == y: -            return 0 -        elif self.rank[x] > self.rank[y]: -            self.root[x] += self.root[y] -            self.root[y] = x -        else: -            self.root[y] += self.root[x] -            self.root[x] = y -            if self.rank[x] == self.rank[y]: -                self.rank[y] += 1 - -    def size(self, x): -        return -self.root[self.find(x)] +input = sys.stdin.buffer.readline +n, m = list(map(int, input().split())) +es = [list(map(int, input().split())) for _ in range(m)] -n, m, *l = list(map(int, open(0).read().split())) -edges = [(a, b) for a, b in zip(l[::2], l[1::2])] -ans = 0 -for i in range(m): -    uf = UnionFind(n) -    for j in range(m): -        if i == j: -            continue -        else: -            a, b = edges[j] -            uf.unite(a, b) -    ans += uf.size(a) < n -print(ans) +def check(s, t): +    q = [0] +    vis = [0] * n +    vis[0] = 1 +    while q: +        c = q.pop() +        for x in con[c]: +            if (c == s and x == t) or (c == t and x == s) or vis[x]: +                continue +            vis[x] = 1 +            q.append(x) +    return not all(vis) + + +con = [[] for _ in range(n)] +for s, t in es: +    con[s - 1] += (t - 1,) +    con[t - 1] += (s - 1,) +print((sum(check(s - 1, t - 1) for s, t in es)))