import copy



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

l_2d = [[0] * N for i in range(N)]

edges=[]



def dfs(i):

    l_visit[i-1]=1

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

        if l_2d_temp[i-1][j-1]==1 and l_visit[j-1]==0:

            dfs(j)

    return



for _ in range(M):

    i,j=list(map(int,input().split()))

    edges.append([i,j])

    l_2d[i-1][j-1]=1

    l_2d[j-1][i-1]=1

    

ans=0

for edge in edges:

    i,j=edge

    l_2d_temp=copy.deepcopy(l_2d)

    l_2d_temp[i-1][j-1]=0

    l_2d_temp[j-1][i-1]=0



    l_visit=[0]*N



    dfs(1)

    if 0 in l_visit:

        ans+=1



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



R = []

G = {k: [] for k in range(N)}  # 0-indexed

for _ in range(M):

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

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

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

    R.append((a-1, b-1))





def dfs(p, i, arrived):

    for n in G[p]:

        if arrived[n] is False and tuple(sorted((p, n))) != R[i]:

            arrived[n] = True

            dfs(n, i, arrived)





ans = 0

for i in range(M):

    arrived = [False]*N

    arrived[0] = True

    dfs(0, i, arrived)

    if not all(arrived):

        ans += 1

print(ans)

import copy

N, M = list(map(int, input().split()))
l_2d = [[0] * N for i in range(N)]
edges = []


def dfs(i):
    l_visit[i - 1] = 1
    for j in range(1, N + 1):
        if l_2d_temp[i - 1][j - 1] == 1 and l_visit[j - 1] == 0:
            dfs(j)
    return


for _ in range(M):
    i, j = list(map(int, input().split()))
    edges.append([i, j])
    l_2d[i - 1][j - 1] = 1
    l_2d[j - 1][i - 1] = 1
ans = 0
for edge in edges:
    i, j = edge
    l_2d_temp = copy.deepcopy(l_2d)
    l_2d_temp[i - 1][j - 1] = 0
    l_2d_temp[j - 1][i - 1] = 0
    l_visit = [0] * N
    dfs(1)
    if 0 in l_visit:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
R = []
G = {k: [] for k in range(N)}  # 0-indexed
for _ in range(M):
    a, b = list(map(int, input().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
    R.append((a - 1, b - 1))


def dfs(p, i, arrived):
    for n in G[p]:
        if arrived[n] is False and tuple(sorted((p, n))) != R[i]:
            arrived[n] = True
            dfs(n, i, arrived)


ans = 0
for i in range(M):
    arrived = [False] * N
    arrived[0] = True
    dfs(0, i, arrived)
    if not all(arrived):
        ans += 1
print(ans)

-import copy - -l_2d = [[0] * N for i in range(N)] -edges = [] +R = [] +G = {k: [] for k in range(N)}  # 0-indexed +for _ in range(M): +    a, b = list(map(int, input().split())) +    G[a - 1].append(b - 1) +    G[b - 1].append(a - 1) +    R.append((a - 1, b - 1)) -def dfs(i): -    l_visit[i - 1] = 1 -    for j in range(1, N + 1): -        if l_2d_temp[i - 1][j - 1] == 1 and l_visit[j - 1] == 0: -            dfs(j) -    return +def dfs(p, i, arrived): +    for n in G[p]: +        if arrived[n] is False and tuple(sorted((p, n))) != R[i]: +            arrived[n] = True +            dfs(n, i, arrived) -for _ in range(M): -    i, j = list(map(int, input().split())) -    edges.append([i, j]) -    l_2d[i - 1][j - 1] = 1 -    l_2d[j - 1][i - 1] = 1 -for edge in edges: -    i, j = edge -    l_2d_temp = copy.deepcopy(l_2d) -    l_2d_temp[i - 1][j - 1] = 0 -    l_2d_temp[j - 1][i - 1] = 0 -    l_visit = [0] * N -    dfs(1) -    if 0 in l_visit: +for i in range(M): +    arrived = [False] * N +    arrived[0] = True +    dfs(0, i, arrived) +    if not all(arrived):