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

E = [list(map(int, input().split())) for k in range(M)]



ans = 0

for k in range(M):

    F = E[:k]+E[k+1:]

    D = [[10**9+7 for l in range(N)] for m in range(N)]

    for p in range(N):

        D[p][p] = 0

    for n in F:

        D[n[0]-1][n[1]-1] = D[n[1]-1][n[0]-1] = 1

    for s in range(N):

        for t in range(N):

            for u in range(N):

                if D[t][u] > D[t][s] + D[s][u]:

                    D[t][u] = D[t][s] + D[s][u]

    f = 0

    for p in range(N):

        for q in range(N):

            if D[p][q] > N:

                f = 1

    ans += f

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

P = [list(map(int,input().split())) for k in range(M)]

ans = 0



for i in range(M):

    T = P[:i]+P[i+1:]

    G = [[] for k in range(N)]

    V = [0 for k in range(N)]

    for e in T:

        G[e[0]-1].append(e[1]-1)

        G[e[1]-1].append(e[0]-1)



    def dfs(visited,graph,ima):

        for e in graph[ima]:

            if visited[e] == 0:

                visited[e] = 1

                dfs(visited,graph,e)

    dfs(V,G,0)

    if sum(V) != N:

        ans += 1

print(ans)

N, M = list(map(int, input().split()))
E = [list(map(int, input().split())) for k in range(M)]
ans = 0
for k in range(M):
    F = E[:k] + E[k + 1 :]
    D = [[10**9 + 7 for l in range(N)] for m in range(N)]
    for p in range(N):
        D[p][p] = 0
    for n in F:
        D[n[0] - 1][n[1] - 1] = D[n[1] - 1][n[0] - 1] = 1
    for s in range(N):
        for t in range(N):
            for u in range(N):
                if D[t][u] > D[t][s] + D[s][u]:
                    D[t][u] = D[t][s] + D[s][u]
    f = 0
    for p in range(N):
        for q in range(N):
            if D[p][q] > N:
                f = 1
    ans += f
print(ans)

N, M = list(map(int, input().split()))
P = [list(map(int, input().split())) for k in range(M)]
ans = 0
for i in range(M):
    T = P[:i] + P[i + 1 :]
    G = [[] for k in range(N)]
    V = [0 for k in range(N)]
    for e in T:
        G[e[0] - 1].append(e[1] - 1)
        G[e[1] - 1].append(e[0] - 1)

    def dfs(visited, graph, ima):
        for e in graph[ima]:
            if visited[e] == 0:
                visited[e] = 1
                dfs(visited, graph, e)

    dfs(V, G, 0)
    if sum(V) != N:
        ans += 1
print(ans)

-E = [list(map(int, input().split())) for k in range(M)] +P = [list(map(int, input().split())) for k in range(M)] -for k in range(M): -    F = E[:k] + E[k + 1 :] -    D = [[10**9 + 7 for l in range(N)] for m in range(N)] -    for p in range(N): -        D[p][p] = 0 -    for n in F: -        D[n[0] - 1][n[1] - 1] = D[n[1] - 1][n[0] - 1] = 1 -    for s in range(N): -        for t in range(N): -            for u in range(N): -                if D[t][u] > D[t][s] + D[s][u]: -                    D[t][u] = D[t][s] + D[s][u] -    f = 0 -    for p in range(N): -        for q in range(N): -            if D[p][q] > N: -                f = 1 -    ans += f +for i in range(M): +    T = P[:i] + P[i + 1 :] +    G = [[] for k in range(N)] +    V = [0 for k in range(N)] +    for e in T: +        G[e[0] - 1].append(e[1] - 1) +        G[e[1] - 1].append(e[0] - 1) + +    def dfs(visited, graph, ima): +        for e in graph[ima]: +            if visited[e] == 0: +                visited[e] = 1 +                dfs(visited, graph, e) + +    dfs(V, G, 0) +    if sum(V) != N: +        ans += 1