def find(x):

    if x != T[x][0]:

        while x!=T[x][0]:

            x = T[x][0]

    return x

def union(x,y):

    rt0 = find(x)

    rt1 = find(y)

    if T[rt0][1]>T[rt1][1]:

        T[rt1][0] = rt0

    elif T[rt0][1]==T[rt1][1]:

        T[rt1][0] = rt0

        T[rt0][1] += 1

    else:

        T[rt0][0] = rt1

        

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

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

B = []

for j in range(M):

    T = {i:[i,0] for i in range(1,N+1)}

    for i in range(M):

        if i==j:continue

        a,b = A[i]

        union(a,b)

    R = [0 for _ in range(N+1)]

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

        rt = find(k)

        if R[rt]==0:

            R[rt]=1

    if sum(R)>1:

        B.append(j)

print((len(B)))
from collections import deque

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

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

cnt = 0

for x in A:

    G = {i:[] for i in range(1,N+1)}

    for y in A:

        if y!=x:

            a,b = y

            G[a].append(b)

            G[b].append(a)

    hist = [0 for _ in range(N+1)]

    que = deque([1])

    hist[1] = 1

    while que:

        z = que.popleft()

        for w in G[z]:

            if hist[w]==0:

                que.append(w)

                hist[w]=1

    if sum(hist)<N:

        cnt += 1

print(cnt)
def find(x):
    if x != T[x][0]:
        while x != T[x][0]:
            x = T[x][0]
    return x


def union(x, y):
    rt0 = find(x)
    rt1 = find(y)
    if T[rt0][1] > T[rt1][1]:
        T[rt1][0] = rt0
    elif T[rt0][1] == T[rt1][1]:
        T[rt1][0] = rt0
        T[rt0][1] += 1
    else:
        T[rt0][0] = rt1


N, M = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(M)]
B = []
for j in range(M):
    T = {i: [i, 0] for i in range(1, N + 1)}
    for i in range(M):
        if i == j:
            continue
        a, b = A[i]
        union(a, b)
    R = [0 for _ in range(N + 1)]
    for k in range(1, N + 1):
        rt = find(k)
        if R[rt] == 0:
            R[rt] = 1
    if sum(R) > 1:
        B.append(j)
print((len(B)))

from collections import deque

N, M = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(M)]
cnt = 0
for x in A:
    G = {i: [] for i in range(1, N + 1)}
    for y in A:
        if y != x:
            a, b = y
            G[a].append(b)
            G[b].append(a)
    hist = [0 for _ in range(N + 1)]
    que = deque([1])
    hist[1] = 1
    while que:
        z = que.popleft()
        for w in G[z]:
            if hist[w] == 0:
                que.append(w)
                hist[w] = 1
    if sum(hist) < N:
        cnt += 1
print(cnt)

-def find(x): -    if x != T[x][0]: -        while x != T[x][0]: -            x = T[x][0] -    return x - - -def union(x, y): -    rt0 = find(x) -    rt1 = find(y) -    if T[rt0][1] > T[rt1][1]: -        T[rt1][0] = rt0 -    elif T[rt0][1] == T[rt1][1]: -        T[rt1][0] = rt0 -        T[rt0][1] += 1 -    else: -        T[rt0][0] = rt1 - +from collections import deque -B = [] -for j in range(M): -    T = {i: [i, 0] for i in range(1, N + 1)} -    for i in range(M): -        if i == j: -            continue -        a, b = A[i] -        union(a, b) -    R = [0 for _ in range(N + 1)] -    for k in range(1, N + 1): -        rt = find(k) -        if R[rt] == 0: -            R[rt] = 1 -    if sum(R) > 1: -        B.append(j) -print((len(B))) +cnt = 0 +for x in A: +    G = {i: [] for i in range(1, N + 1)} +    for y in A: +        if y != x: +            a, b = y +            G[a].append(b) +            G[b].append(a) +    hist = [0 for _ in range(N + 1)] +    que = deque([1]) +    hist[1] = 1 +    while que: +        z = que.popleft() +        for w in G[z]: +            if hist[w] == 0: +                que.append(w) +                hist[w] = 1 +    if sum(hist) < N: +        cnt += 1 +print(cnt)