import copy





def main():

    # n: 頂点数

    # w: 辺の数

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

    # v -> v ; cost: 0

    d = [[False] * n for i in range(n)]



    # d[u][v] : 辺u-vのコスト(if not: inf)

    e = []

    for i in range(w):

        # edge: u -> v ; cost : z

        u, v = [int(x) - 1 for x in input().split()]

        e.append([u, v])

        # 無向グラフを想定

        d[u][v] = True

        d[v][u] = True



    def dfs(graph, visited, x):

        if visited[x]:

            return

        visited[x] = True

        for i in range(n):

            if graph[x][i]:

                dfs(graph, visited, i)



    ans = 0

    for (u, v) in e:

        graph = copy.deepcopy(d)

        graph[u][v] = False

        graph[v][u] = False

        for i in range(n):

            visited = [False for _ in range(n)]

            dfs(graph, visited, i)

            if not all(visited):

                ans += 1

                break

    print(ans)





if __name__ == "__main__":

    main()

def main():

    n, m, *ab = list(map(int, open(0).read().split()))

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

    for u, v in zip(*[iter(ab)] * 2):

        e[u - 1].append(v - 1)

        e[v - 1].append(u - 1)



    ans = 0

    for _ in range(m):

        count = 0

        for i, x in enumerate(e):

            if len(x) == 1:

                e[i] = []

                e[x[0]].remove(i)

                count += 1

        if count:

            ans += count

        else:

            break



    print(ans)





if __name__ == "__main__":

    main()

import copy


def main():
    # n: 頂点数
    # w: 辺の数
    n, w = list(map(int, input().split()))
    # v -> v ; cost: 0
    d = [[False] * n for i in range(n)]
    # d[u][v] : 辺u-vのコスト(if not: inf)
    e = []
    for i in range(w):
        # edge: u -> v ; cost : z
        u, v = [int(x) - 1 for x in input().split()]
        e.append([u, v])
        # 無向グラフを想定
        d[u][v] = True
        d[v][u] = True

    def dfs(graph, visited, x):
        if visited[x]:
            return
        visited[x] = True
        for i in range(n):
            if graph[x][i]:
                dfs(graph, visited, i)

    ans = 0
    for (u, v) in e:
        graph = copy.deepcopy(d)
        graph[u][v] = False
        graph[v][u] = False
        for i in range(n):
            visited = [False for _ in range(n)]
            dfs(graph, visited, i)
            if not all(visited):
                ans += 1
                break
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n, m, *ab = list(map(int, open(0).read().split()))
    e = [[] for _ in range(n)]
    for u, v in zip(*[iter(ab)] * 2):
        e[u - 1].append(v - 1)
        e[v - 1].append(u - 1)
    ans = 0
    for _ in range(m):
        count = 0
        for i, x in enumerate(e):
            if len(x) == 1:
                e[i] = []
                e[x[0]].remove(i)
                count += 1
        if count:
            ans += count
        else:
            break
    print(ans)


if __name__ == "__main__":
    main()

-import copy - - -    # n: 頂点数 -    # w: 辺の数 -    n, w = list(map(int, input().split())) -    # v -> v ; cost: 0 -    d = [[False] * n for i in range(n)] -    # d[u][v] : 辺u-vのコスト(if not: inf) -    e = [] -    for i in range(w): -        # edge: u -> v ; cost : z -        u, v = [int(x) - 1 for x in input().split()] -        e.append([u, v]) -        # 無向グラフを想定 -        d[u][v] = True -        d[v][u] = True - -    def dfs(graph, visited, x): -        if visited[x]: -            return -        visited[x] = True -        for i in range(n): -            if graph[x][i]: -                dfs(graph, visited, i) - +    n, m, *ab = list(map(int, open(0).read().split())) +    e = [[] for _ in range(n)] +    for u, v in zip(*[iter(ab)] * 2): +        e[u - 1].append(v - 1) +        e[v - 1].append(u - 1) -    for (u, v) in e: -        graph = copy.deepcopy(d) -        graph[u][v] = False -        graph[v][u] = False -        for i in range(n): -            visited = [False for _ in range(n)] -            dfs(graph, visited, i) -            if not all(visited): -                ans += 1 -                break +    for _ in range(m): +        count = 0 +        for i, x in enumerate(e): +            if len(x) == 1: +                e[i] = [] +                e[x[0]].remove(i) +                count += 1 +        if count: +            ans += count +        else: +            break