import copy

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

A=[]

L=[[1000for i in range(N)]for j in range(N)]

for i in range(M):

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

    A.append([a,b])

    L[a-1][b-1]=1

    L[b-1][a-1]=1

    

for j in range(N):

    L[j][j]=0



#print(L)

l=copy.deepcopy(L)



cnt=0

for k in range(M):

    L=copy.deepcopy(l)

    L[A[k][0]-1][A[k][1]-1]=1000

    L[A[k][1]-1][A[k][0]-1]=1000

    for x in range(N):

        for y in range(N):

            for z in range(N):

                if L[y][z]>L[y][x]+L[x][z]:

                    L[y][z]=L[y][x]+L[x][z]

    #print(L[A[k][0]-1][A[k][1]-1])

    if L[A[k][0]-1][A[k][1]-1]>=1000:

        cnt+=1

    L[A[k][0]-1][A[k][1]-1]=1

    L[A[k][1]-1][A[k][0]-1]=1

#print(L)   

print(cnt)
import copy

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

A=[]



for i in range(M):

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

    A.append([a,b])

    

ANS=0

for i in range(M):

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

    for j in range(M):

        if i==j:

            continue

        else:

            L[A[j][0]].append((A[j][1],A[j][0]))

            L[A[j][1]].append((A[j][0],A[j][1]))

    X=1

    C=[100 for i in range(N+1)]

    C[1]=1

    C[0]=1

    Q=L[1]

    #print(L)

    for j in range(1000):

        if len(Q)==j:

            break

        if C[Q[j][0]]==100:

            C[Q[j][0]]=C[Q[j][1]]+1

            for k in L[Q[j][0]]:

                if C[k[0]]==100:

                    Q.append((k[0],k[1]))

    #print(Q)

    #print(C)

    if 100 in C:

        ANS+=1

print(ANS)
import copy

N, M = list(map(int, input().split()))
A = []
L = [[1000 for i in range(N)] for j in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    A.append([a, b])
    L[a - 1][b - 1] = 1
    L[b - 1][a - 1] = 1
for j in range(N):
    L[j][j] = 0
# print(L)
l = copy.deepcopy(L)
cnt = 0
for k in range(M):
    L = copy.deepcopy(l)
    L[A[k][0] - 1][A[k][1] - 1] = 1000
    L[A[k][1] - 1][A[k][0] - 1] = 1000
    for x in range(N):
        for y in range(N):
            for z in range(N):
                if L[y][z] > L[y][x] + L[x][z]:
                    L[y][z] = L[y][x] + L[x][z]
    # print(L[A[k][0]-1][A[k][1]-1])
    if L[A[k][0] - 1][A[k][1] - 1] >= 1000:
        cnt += 1
    L[A[k][0] - 1][A[k][1] - 1] = 1
    L[A[k][1] - 1][A[k][0] - 1] = 1
# print(L)
print(cnt)

import copy

N, M = list(map(int, input().split()))
A = []
for i in range(M):
    a, b = list(map(int, input().split()))
    A.append([a, b])
ANS = 0
for i in range(M):
    L = [[] for _ in range(N + 1)]
    for j in range(M):
        if i == j:
            continue
        else:
            L[A[j][0]].append((A[j][1], A[j][0]))
            L[A[j][1]].append((A[j][0], A[j][1]))
    X = 1
    C = [100 for i in range(N + 1)]
    C[1] = 1
    C[0] = 1
    Q = L[1]
    # print(L)
    for j in range(1000):
        if len(Q) == j:
            break
        if C[Q[j][0]] == 100:
            C[Q[j][0]] = C[Q[j][1]] + 1
            for k in L[Q[j][0]]:
                if C[k[0]] == 100:
                    Q.append((k[0], k[1]))
    # print(Q)
    # print(C)
    if 100 in C:
        ANS += 1
print(ANS)

-L = [[1000 for i in range(N)] for j in range(N)] -    L[a - 1][b - 1] = 1 -    L[b - 1][a - 1] = 1 -for j in range(N): -    L[j][j] = 0 -# print(L) -l = copy.deepcopy(L) -cnt = 0 -for k in range(M): -    L = copy.deepcopy(l) -    L[A[k][0] - 1][A[k][1] - 1] = 1000 -    L[A[k][1] - 1][A[k][0] - 1] = 1000 -    for x in range(N): -        for y in range(N): -            for z in range(N): -                if L[y][z] > L[y][x] + L[x][z]: -                    L[y][z] = L[y][x] + L[x][z] -    # print(L[A[k][0]-1][A[k][1]-1]) -    if L[A[k][0] - 1][A[k][1] - 1] >= 1000: -        cnt += 1 -    L[A[k][0] - 1][A[k][1] - 1] = 1 -    L[A[k][1] - 1][A[k][0] - 1] = 1 -# print(L) -print(cnt) +ANS = 0 +for i in range(M): +    L = [[] for _ in range(N + 1)] +    for j in range(M): +        if i == j: +            continue +        else: +            L[A[j][0]].append((A[j][1], A[j][0])) +            L[A[j][1]].append((A[j][0], A[j][1])) +    X = 1 +    C = [100 for i in range(N + 1)] +    C[1] = 1 +    C[0] = 1 +    Q = L[1] +    # print(L) +    for j in range(1000): +        if len(Q) == j: +            break +        if C[Q[j][0]] == 100: +            C[Q[j][0]] = C[Q[j][1]] + 1 +            for k in L[Q[j][0]]: +                if C[k[0]] == 100: +                    Q.append((k[0], k[1])) +    # print(Q) +    # print(C) +    if 100 in C: +        ANS += 1 +print(ANS)