from copy import deepcopy





def dfs(v):

    visited[v] = 1

    ret = 1

    for w in range(n):

        if [v, w] not in r:

            continue

        elif visited[w] == 1:

            continue

        ret += dfs(w)

        visited[w] = 1

    return ret





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

x = []

cnt = 0

for _ in range(m):

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

    x.append([a-1,b-1])

    x.append([b-1, a-1])

for i in range(m):

    r = deepcopy(x)

    r.pop(2*i)

    r.pop(2*i)

    visited = [0]*n

    if dfs(0) == n:

        cnt += 1

print((m-cnt))
from copy import deepcopy





def dfs(v):

    visited[v] = 1

    ret = 1

    for w in r[v]:

        if visited[w] == 1:

            continue

        ret += dfs(w)

        visited[w] = 1

    return ret





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

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

x_list = []

cnt = 0

for _ in range(m):

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

    x_list.append([a-1,b-1])

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

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

for i in range(m):

    r = deepcopy(x)

    r[x_list[i][0]].remove(x_list[i][1])

    r[x_list[i][1]].remove(x_list[i][0])

    visited = [0]*n

    if dfs(0) == n:

        cnt += 1

print((m-cnt))
from copy import deepcopy


def dfs(v):
    visited[v] = 1
    ret = 1
    for w in range(n):
        if [v, w] not in r:
            continue
        elif visited[w] == 1:
            continue
        ret += dfs(w)
        visited[w] = 1
    return ret


n, m = list(map(int, input().split()))
x = []
cnt = 0
for _ in range(m):
    a, b = list(map(int, input().split()))
    x.append([a - 1, b - 1])
    x.append([b - 1, a - 1])
for i in range(m):
    r = deepcopy(x)
    r.pop(2 * i)
    r.pop(2 * i)
    visited = [0] * n
    if dfs(0) == n:
        cnt += 1
print((m - cnt))

from copy import deepcopy


def dfs(v):
    visited[v] = 1
    ret = 1
    for w in r[v]:
        if visited[w] == 1:
            continue
        ret += dfs(w)
        visited[w] = 1
    return ret


n, m = list(map(int, input().split()))
x = [[] for _ in range(n)]
x_list = []
cnt = 0
for _ in range(m):
    a, b = list(map(int, input().split()))
    x_list.append([a - 1, b - 1])
    x[a - 1].append(b - 1)
    x[b - 1].append(a - 1)
for i in range(m):
    r = deepcopy(x)
    r[x_list[i][0]].remove(x_list[i][1])
    r[x_list[i][1]].remove(x_list[i][0])
    visited = [0] * n
    if dfs(0) == n:
        cnt += 1
print((m - cnt))

-    for w in range(n): -        if [v, w] not in r: -            continue -        elif visited[w] == 1: +    for w in r[v]: +        if visited[w] == 1: -x = [] +x = [[] for _ in range(n)] +x_list = [] -    x.append([a - 1, b - 1]) -    x.append([b - 1, a - 1]) +    x_list.append([a - 1, b - 1]) +    x[a - 1].append(b - 1) +    x[b - 1].append(a - 1) -    r.pop(2 * i) -    r.pop(2 * i) +    r[x_list[i][0]].remove(x_list[i][1]) +    r[x_list[i][1]].remove(x_list[i][0])