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

d = [[float("inf")] * n for i in range(n)]

edge = []

for i in range(m):

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

    edge.append((a, b))

    d[a - 1][b - 1] = 1

    d[b - 1][a - 1] = 1

ans = 0

for a in range(m):

    d_s = [x[:] for x in d]

    x, y = edge[a]

    d_s[x - 1][y - 1] = float("inf")

    d_s[y - 1][x - 1] = float("inf")

    for k in range(n):

        for i in range(n):

            for j in range(n):

                d_s[i][j] = min(d_s[i][j], d_s[i][k] + d_s[k][j])

    flag = 0

    for i in range(n):

        if flag:

            break

        for j in range(n):

            if flag:

                break

            if d_s[i][j] == float("inf"):

                ans += 1

                flag = 1

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

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

ans = 0

for i in edge:

    l = list(range(n))

    for j in edge:

        if j != i:

            l = [l[j[0] - 1] if l[k] == l[j[1] - 1] else l[k] for k in range(n)]

    if len(set(l)) != 1:

        ans += 1

print(ans)
n, m = list(map(int, input().split()))
d = [[float("inf")] * n for i in range(n)]
edge = []
for i in range(m):
    a, b = list(map(int, input().split()))
    edge.append((a, b))
    d[a - 1][b - 1] = 1
    d[b - 1][a - 1] = 1
ans = 0
for a in range(m):
    d_s = [x[:] for x in d]
    x, y = edge[a]
    d_s[x - 1][y - 1] = float("inf")
    d_s[y - 1][x - 1] = float("inf")
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d_s[i][j] = min(d_s[i][j], d_s[i][k] + d_s[k][j])
    flag = 0
    for i in range(n):
        if flag:
            break
        for j in range(n):
            if flag:
                break
            if d_s[i][j] == float("inf"):
                ans += 1
                flag = 1
print(ans)

n, m = list(map(int, input().split()))
edge = [list(map(int, input().split())) for i in range(m)]
ans = 0
for i in edge:
    l = list(range(n))
    for j in edge:
        if j != i:
            l = [l[j[0] - 1] if l[k] == l[j[1] - 1] else l[k] for k in range(n)]
    if len(set(l)) != 1:
        ans += 1
print(ans)

-d = [[float("inf")] * n for i in range(n)] -edge = [] -for i in range(m): -    a, b = list(map(int, input().split())) -    edge.append((a, b)) -    d[a - 1][b - 1] = 1 -    d[b - 1][a - 1] = 1 +edge = [list(map(int, input().split())) for i in range(m)] -for a in range(m): -    d_s = [x[:] for x in d] -    x, y = edge[a] -    d_s[x - 1][y - 1] = float("inf") -    d_s[y - 1][x - 1] = float("inf") -    for k in range(n): -        for i in range(n): -            for j in range(n): -                d_s[i][j] = min(d_s[i][j], d_s[i][k] + d_s[k][j]) -    flag = 0 -    for i in range(n): -        if flag: -            break -        for j in range(n): -            if flag: -                break -            if d_s[i][j] == float("inf"): -                ans += 1 -                flag = 1 +for i in edge: +    l = list(range(n)) +    for j in edge: +        if j != i: +            l = [l[j[0] - 1] if l[k] == l[j[1] - 1] else l[k] for k in range(n)] +    if len(set(l)) != 1: +        ans += 1