from collections import Counter



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

err = 0

ans = 0



par = [0] * n

rank = [0] * n



#初期化

for i in range(n):

    par[i] = i

    rank[i] = 0



#判定(一番上野根を求める)

def find(x):

    if par[x] == x:

        return x

    else:

        par[x] = find(par[x])

        return par[x]

    

#結合

def unite(x , y):

    rx = find(x)

    ry = find(y)

    

    if rx == ry:

        return

    

    if rank[rx] < rank[ry]:

        par[rx] = ry

    elif rank[rx] > rank[ry]:

        par[ry] = rx

    else:

        par[ry] = x

        rank[rx] += 1



a = [0] * m

b = [0] * m



for i in range(m):

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



ans = 0

for i in range(m):

    for v in range(n):

        par[v] = v

        rank[v] = 0

        

    for j in range(m):

        if j == i:

            continue

        unite(a[j]-1 , b[j]-1)

        r = [find(k) for k in range(n)]

    if len(Counter(r)) != 1:

        ans += 1

        

print(ans)
from collections import Counter



maxn = 100000



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



par = [0] * n

rank = [0] * n



#初期化

for i in range(n):

    par[i] = i

    rank[i] = 0



#判定(一番上野根を求める)

def find(x):

    if par[x] == x:

        return x

    else:

        par[x] = find(par[x])

        return par[x]

    

#結合

def unite(x , y):

    rx = find(x)

    ry = find(y)

    

    if rx == ry:

        return

    

    if rank[rx] < rank[ry]:

        par[rx] = ry

    elif rank[rx] > rank[ry]:

        par[ry] = rx

    else:

        par[ry] = x

        rank[rx] += 1



a = [0] * m

b = [0] * m

for i in range(m):

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

    a[i] -= 1

    b[i] -= 1

    

ans = 0

for i in range(m):

    for j in range(n):

        par[j] = j

        rank[j] = 0

        

    for j in range(m):

        if i == j:

            continue

        unite(a[j],b[j])

        

    l = [find(k) for k in range(n)]

    fl = 1

    

    for j in range(n-1):

        if l[j] != l[j+1]:

            fl = 0

            

    if fl == 0:

        ans += 1

        

print(ans)
from collections import Counter

n, m = list(map(int, input().split()))
err = 0
ans = 0
par = [0] * n
rank = [0] * n
# 初期化
for i in range(n):
    par[i] = i
    rank[i] = 0
# 判定(一番上野根を求める)
def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


# 結合
def unite(x, y):
    rx = find(x)
    ry = find(y)
    if rx == ry:
        return
    if rank[rx] < rank[ry]:
        par[rx] = ry
    elif rank[rx] > rank[ry]:
        par[ry] = rx
    else:
        par[ry] = x
        rank[rx] += 1


a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = list(map(int, input().split()))
ans = 0
for i in range(m):
    for v in range(n):
        par[v] = v
        rank[v] = 0
    for j in range(m):
        if j == i:
            continue
        unite(a[j] - 1, b[j] - 1)
        r = [find(k) for k in range(n)]
    if len(Counter(r)) != 1:
        ans += 1
print(ans)

from collections import Counter

maxn = 100000
n, m = list(map(int, input().split()))
par = [0] * n
rank = [0] * n
# 初期化
for i in range(n):
    par[i] = i
    rank[i] = 0
# 判定(一番上野根を求める)
def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


# 結合
def unite(x, y):
    rx = find(x)
    ry = find(y)
    if rx == ry:
        return
    if rank[rx] < rank[ry]:
        par[rx] = ry
    elif rank[rx] > rank[ry]:
        par[ry] = rx
    else:
        par[ry] = x
        rank[rx] += 1


a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = list(map(int, input().split()))
    a[i] -= 1
    b[i] -= 1
ans = 0
for i in range(m):
    for j in range(n):
        par[j] = j
        rank[j] = 0
    for j in range(m):
        if i == j:
            continue
        unite(a[j], b[j])
    l = [find(k) for k in range(n)]
    fl = 1
    for j in range(n - 1):
        if l[j] != l[j + 1]:
            fl = 0
    if fl == 0:
        ans += 1
print(ans)

+maxn = 100000 -err = 0 -ans = 0 +    a[i] -= 1 +    b[i] -= 1 -    for v in range(n): -        par[v] = v -        rank[v] = 0 +    for j in range(n): +        par[j] = j +        rank[j] = 0 -        if j == i: +        if i == j: -        unite(a[j] - 1, b[j] - 1) -        r = [find(k) for k in range(n)] -    if len(Counter(r)) != 1: +        unite(a[j], b[j]) +    l = [find(k) for k in range(n)] +    fl = 1 +    for j in range(n - 1): +        if l[j] != l[j + 1]: +            fl = 0 +    if fl == 0: