from collections import deque

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

X=[]

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

for i in range(m):

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

    X.append([a,b])

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

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

ans=0

for i in range(m):

    se={X[i][0]-1,X[i][1]-1}

    q=deque([0])

    visited=[0]*n

    while q:

        s=q.popleft()

        if visited[s]==1:

            continue

        visited[s]=1

        for x in M[s]:

            if {s,x}!=se:

                q.append(x)

    if sum(visited)!=n:

        ans+=1

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

X=[]

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

for i in range(m):

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

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

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

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

ans=0



def dfs(x,se):

    visited[x]=1

    for m in M[x]:

        if se!={x,m} and visited[m]==0:

            dfs(m,se)





for i in range(m):

    visited=[0]*n

    dfs(0,set(X[i]))

    if 0 in visited:

        ans+=1

print(ans)
from collections import deque

n, m = list(map(int, input().split()))
X = []
M = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    X.append([a, b])
    M[a - 1].append(b - 1)
    M[b - 1].append(a - 1)
ans = 0
for i in range(m):
    se = {X[i][0] - 1, X[i][1] - 1}
    q = deque([0])
    visited = [0] * n
    while q:
        s = q.popleft()
        if visited[s] == 1:
            continue
        visited[s] = 1
        for x in M[s]:
            if {s, x} != se:
                q.append(x)
    if sum(visited) != n:
        ans += 1
print(ans)

n, m = list(map(int, input().split()))
X = []
M = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    X.append([a - 1, b - 1])
    M[a - 1].append(b - 1)
    M[b - 1].append(a - 1)
ans = 0


def dfs(x, se):
    visited[x] = 1
    for m in M[x]:
        if se != {x, m} and visited[m] == 0:
            dfs(m, se)


for i in range(m):
    visited = [0] * n
    dfs(0, set(X[i]))
    if 0 in visited:
        ans += 1
print(ans)

-from collections import deque - -    X.append([a, b]) +    X.append([a - 1, b - 1]) + + +def dfs(x, se): +    visited[x] = 1 +    for m in M[x]: +        if se != {x, m} and visited[m] == 0: +            dfs(m, se) + + -    se = {X[i][0] - 1, X[i][1] - 1} -    q = deque([0]) -    while q: -        s = q.popleft() -        if visited[s] == 1: -            continue -        visited[s] = 1 -        for x in M[s]: -            if {s, x} != se: -                q.append(x) -    if sum(visited) != n: +    dfs(0, set(X[i])) +    if 0 in visited: