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

src = [tuple([int(x)-1 for x in input().split()]) for i in range(M)]



parent = [i for i in range(N)]

rank = [0] * N

def root(a):

    if parent[a] == a:

        return a

    else:

        parent[a] = root(parent[a])

        return parent[a]

def is_same(a,b):

    return root(a) == root(b)

def unite(a,b):

    ra = root(a)

    rb = root(b)

    if ra == rb: return

    if rank[ra] < rank[rb]:

        parent[ra] = rb

    else:

        parent[rb] = ra

        if rank[ra] == rank[rb]: rank[ra] += 1



ans = 0

for i in range(M):

    parent = [i for i in range(N)]

    rank = [0] * N

    for j,(a,b) in enumerate(src):

        if i == j: continue

        unite(a,b)

    if len(set([root(i) for i in range(N)])) > 1:

        ans += 1

print(ans)

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

es = [tuple([int(x)-1 for x in input().split()]) for i in range(M)]

gr = [[] for i in range(N)]

for i,(a,b) in enumerate(es):

    gr[a].append((b,i))

    gr[b].append((a,i))



ans = 0

for i in range(M):

    visited = [0] * N

    stack = [0]

    while stack:

        v = stack.pop()

        visited[v] = 1

        for to,e in gr[v]:

            if visited[to]: continue

            if i==e: continue

            stack.append(to)

    if sum(visited) < N:

        ans += 1

print(ans)
N, M = list(map(int, input().split()))
src = [tuple([int(x) - 1 for x in input().split()]) for i in range(M)]
parent = [i for i in range(N)]
rank = [0] * N


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


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


def unite(a, b):
    ra = root(a)
    rb = root(b)
    if ra == rb:
        return
    if rank[ra] < rank[rb]:
        parent[ra] = rb
    else:
        parent[rb] = ra
        if rank[ra] == rank[rb]:
            rank[ra] += 1


ans = 0
for i in range(M):
    parent = [i for i in range(N)]
    rank = [0] * N
    for j, (a, b) in enumerate(src):
        if i == j:
            continue
        unite(a, b)
    if len(set([root(i) for i in range(N)])) > 1:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
es = [tuple([int(x) - 1 for x in input().split()]) for i in range(M)]
gr = [[] for i in range(N)]
for i, (a, b) in enumerate(es):
    gr[a].append((b, i))
    gr[b].append((a, i))
ans = 0
for i in range(M):
    visited = [0] * N
    stack = [0]
    while stack:
        v = stack.pop()
        visited[v] = 1
        for to, e in gr[v]:
            if visited[to]:
                continue
            if i == e:
                continue
            stack.append(to)
    if sum(visited) < N:
        ans += 1
print(ans)

-src = [tuple([int(x) - 1 for x in input().split()]) for i in range(M)] -parent = [i for i in range(N)] -rank = [0] * N - - -def root(a): -    if parent[a] == a: -        return a -    else: -        parent[a] = root(parent[a]) -        return parent[a] - - -def is_same(a, b): -    return root(a) == root(b) - - -def unite(a, b): -    ra = root(a) -    rb = root(b) -    if ra == rb: -        return -    if rank[ra] < rank[rb]: -        parent[ra] = rb -    else: -        parent[rb] = ra -        if rank[ra] == rank[rb]: -            rank[ra] += 1 - - +es = [tuple([int(x) - 1 for x in input().split()]) for i in range(M)] +gr = [[] for i in range(N)] +for i, (a, b) in enumerate(es): +    gr[a].append((b, i)) +    gr[b].append((a, i)) -    parent = [i for i in range(N)] -    rank = [0] * N -    for j, (a, b) in enumerate(src): -        if i == j: -            continue -        unite(a, b) -    if len(set([root(i) for i in range(N)])) > 1: +    visited = [0] * N +    stack = [0] +    while stack: +        v = stack.pop() +        visited[v] = 1 +        for to, e in gr[v]: +            if visited[to]: +                continue +            if i == e: +                continue +            stack.append(to) +    if sum(visited) < N: