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

d = []

for i in range(m):

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

    a,b = a-1, b-1

    d.append((a,b))

#print(d)

pa = None



def root(a):

    if pa[a] == a:

        return a

    else:

        pa[a] = root(pa[a])

        return pa[a]

def is_same(a,b):

    return root(a) == root(b)

def unite(a,b):

    aa = root(a)

    bb = root(b)

    if aa == bb:

        return

    pa[aa] = bb



ans = 0

for i in range(m):

    pa = [x for x in range(n)]

    for j,v in enumerate(d):

        #(i,j,v)

        if i == j:continue

        a,b = v

        unite(a,b)

    a,b = d[i]

    if not is_same(a,b):

        ans +=1

print(ans)
from collections import deque

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

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

#print(L)

cnt = 0

for i in range(m):

    G = [[] for _ in range(n)]

    

    for j in range(m):

        if i == j:

            continue

        a,b = L[j][0],L[j][1]

        #print(a-1,b-1)

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

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

    #print(G)

    Q = deque()

    Q.append(0)

    visited = [0]*n

    visited[0] = 1

    while Q:

        q = Q.pop()

        for g in G[q]:

            if visited[g] == 0:

                visited[g] = 1

                #print(visited)

                Q.append(g)



    if 0 in visited:

        cnt +=1

print(cnt)
n, m = list(map(int, input().split()))
d = []
for i in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    d.append((a, b))
# print(d)
pa = None


def root(a):
    if pa[a] == a:
        return a
    else:
        pa[a] = root(pa[a])
        return pa[a]


def is_same(a, b):
    return root(a) == root(b)


def unite(a, b):
    aa = root(a)
    bb = root(b)
    if aa == bb:
        return
    pa[aa] = bb


ans = 0
for i in range(m):
    pa = [x for x in range(n)]
    for j, v in enumerate(d):
        # (i,j,v)
        if i == j:
            continue
        a, b = v
        unite(a, b)
    a, b = d[i]
    if not is_same(a, b):
        ans += 1
print(ans)

from collections import deque

n, m = list(map(int, input().split()))
L = [list(map(int, input().split())) for _ in range(m)]
# print(L)
cnt = 0
for i in range(m):
    G = [[] for _ in range(n)]
    for j in range(m):
        if i == j:
            continue
        a, b = L[j][0], L[j][1]
        # print(a-1,b-1)
        G[a - 1].append(b - 1)
        G[b - 1].append(a - 1)
    # print(G)
    Q = deque()
    Q.append(0)
    visited = [0] * n
    visited[0] = 1
    while Q:
        q = Q.pop()
        for g in G[q]:
            if visited[g] == 0:
                visited[g] = 1
                # print(visited)
                Q.append(g)
    if 0 in visited:
        cnt += 1
print(cnt)

+from collections import deque + -d = [] +L = [list(map(int, input().split())) for _ in range(m)] +# print(L) +cnt = 0 -    a, b = list(map(int, input().split())) -    a, b = a - 1, b - 1 -    d.append((a, b)) -# print(d) -pa = None - - -def root(a): -    if pa[a] == a: -        return a -    else: -        pa[a] = root(pa[a]) -        return pa[a] - - -def is_same(a, b): -    return root(a) == root(b) - - -def unite(a, b): -    aa = root(a) -    bb = root(b) -    if aa == bb: -        return -    pa[aa] = bb - - -ans = 0 -for i in range(m): -    pa = [x for x in range(n)] -    for j, v in enumerate(d): -        # (i,j,v) +    G = [[] for _ in range(n)] +    for j in range(m): -        a, b = v -        unite(a, b) -    a, b = d[i] -    if not is_same(a, b): -        ans += 1 -print(ans) +        a, b = L[j][0], L[j][1] +        # print(a-1,b-1) +        G[a - 1].append(b - 1) +        G[b - 1].append(a - 1) +    # print(G) +    Q = deque() +    Q.append(0) +    visited = [0] * n +    visited[0] = 1 +    while Q: +        q = Q.pop() +        for g in G[q]: +            if visited[g] == 0: +                visited[g] = 1 +                # print(visited) +                Q.append(g) +    if 0 in visited: +        cnt += 1 +print(cnt)