import sys,queue,math,numpy as np,scipy as sc

sys.setrecursionlimit(10**7)

input = sys.stdin.readline

INF = 10**18

MOD = 10**9 + 7

LI = lambda : [int(x) for x in input().split()]

N,M = LI()

E = [LI() for _ in range(M)]

ans = 0

for i in range(M):

    g = np.array([i for i in range(N+1)])



    def root(x):

        if g[x] != x:

            g[x] = root(g[x])

        return g[x]



    for j in range(M):

        if i != j: g[root(E[j][0])] = root(E[j][1])



    ans += (root(E[i][0]) != root(E[i][1]))



print (ans)
import sys,queue,math,numpy as np,scipy as sc

sys.setrecursionlimit(10**7)

input = sys.stdin.readline

INF = 10**18

MOD = 10**9 + 7

LI = lambda : [int(x) for x in input().split()]

N,M = LI()

E = [LI() for _ in range(M)]

ans = 0

for i in range(M):

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



    def root(x):

        if g[x] != x:

            g[x] = root(g[x])

        return g[x]



    for j in range(M):

        if i != j: g[root(E[j][0])] = root(E[j][1])



    ans += (root(E[i][0]) != root(E[i][1]))



print (ans)
import sys, queue, math, numpy as np, scipy as sc

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda: [int(x) for x in input().split()]
N, M = LI()
E = [LI() for _ in range(M)]
ans = 0
for i in range(M):
    g = np.array([i for i in range(N + 1)])

    def root(x):
        if g[x] != x:
            g[x] = root(g[x])
        return g[x]

    for j in range(M):
        if i != j:
            g[root(E[j][0])] = root(E[j][1])
    ans += root(E[i][0]) != root(E[i][1])
print(ans)

import sys, queue, math, numpy as np, scipy as sc

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda: [int(x) for x in input().split()]
N, M = LI()
E = [LI() for _ in range(M)]
ans = 0
for i in range(M):
    g = [i for i in range(N + 1)]

    def root(x):
        if g[x] != x:
            g[x] = root(g[x])
        return g[x]

    for j in range(M):
        if i != j:
            g[root(E[j][0])] = root(E[j][1])
    ans += root(E[i][0]) != root(E[i][1])
print(ans)

-    g = np.array([i for i in range(N + 1)]) +    g = [i for i in range(N + 1)]