import numpy as np



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



connect = np.zeros((n,n))



for i in range(m):

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

    connect[a-1, b-1] = 1

    connect[b-1, a-1] = 1



notbridge = 0





for i in range(n):

    for j in range(n):

        if connect[i,j] == 1:

            connect[i,j] = 0

            connect[j,i] = 0

            stack =[1]

            visited = [1]

            while stack:

                p = stack.pop()

                for k in range(n):

                    if connect[p,k] == 1:

                        if k not in visited:

                            stack.append(k)

                            visited.append(k)

            if len(visited) == n:

                notbridge += 1

            connect[i,j] = 1

            connect[j,i] = 1







print((m-notbridge//2))





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



connect = [[0 for i in range(n)] for j in range(n)]



for i in range(m):

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

    connect[a-1][b-1] = 1

    connect[b-1][a-1] = 1



notbridge = 0





for i in range(n):

    for j in range(n):

        if connect[i][j] == 1:

            connect[i][j] = 0

            connect[j][i] = 0

            stack =[1]

            visited = [1]

            while stack:

                p = stack.pop()

                for k in range(n):

                    if connect[p][k] == 1:

                        if k not in visited:

                            stack.append(k)

                            visited.append(k)

            if len(visited) == n:

                notbridge += 1

            connect[i][j] = 1

            connect[j][i] = 1







print((m-notbridge//2))





import numpy as np

n, m = list(map(int, input().split()))
connect = np.zeros((n, n))
for i in range(m):
    a, b = list(map(int, input().split()))
    connect[a - 1, b - 1] = 1
    connect[b - 1, a - 1] = 1
notbridge = 0
for i in range(n):
    for j in range(n):
        if connect[i, j] == 1:
            connect[i, j] = 0
            connect[j, i] = 0
            stack = [1]
            visited = [1]
            while stack:
                p = stack.pop()
                for k in range(n):
                    if connect[p, k] == 1:
                        if k not in visited:
                            stack.append(k)
                            visited.append(k)
            if len(visited) == n:
                notbridge += 1
            connect[i, j] = 1
            connect[j, i] = 1
print((m - notbridge // 2))

n, m = list(map(int, input().split()))
connect = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    connect[a - 1][b - 1] = 1
    connect[b - 1][a - 1] = 1
notbridge = 0
for i in range(n):
    for j in range(n):
        if connect[i][j] == 1:
            connect[i][j] = 0
            connect[j][i] = 0
            stack = [1]
            visited = [1]
            while stack:
                p = stack.pop()
                for k in range(n):
                    if connect[p][k] == 1:
                        if k not in visited:
                            stack.append(k)
                            visited.append(k)
            if len(visited) == n:
                notbridge += 1
            connect[i][j] = 1
            connect[j][i] = 1
print((m - notbridge // 2))

-import numpy as np - -connect = np.zeros((n, n)) +connect = [[0 for i in range(n)] for j in range(n)] -    connect[a - 1, b - 1] = 1 -    connect[b - 1, a - 1] = 1 +    connect[a - 1][b - 1] = 1 +    connect[b - 1][a - 1] = 1 -        if connect[i, j] == 1: -            connect[i, j] = 0 -            connect[j, i] = 0 +        if connect[i][j] == 1: +            connect[i][j] = 0 +            connect[j][i] = 0 -                    if connect[p, k] == 1: +                    if connect[p][k] == 1: -            connect[i, j] = 1 -            connect[j, i] = 1 +            connect[i][j] = 1 +            connect[j][i] = 1