if __name__ == "__main__":

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

    edge = list()

    for i in range(m):

        edge.append(list(map(int, input().split())))



    ans = 0



    def dfs(v):

        visted[v] = True

        for i in range(n):

            if graph[v][i] is False:

                continue

            if visted[i] is True:

                continue

            dfs(i)



    for i in range(m):

        visted = [False] * n

        graph = [[False] * n for _ in range(n)]



        for j in range(m):

            if i != j:

                graph[edge[j][0]-1][edge[j][1]-1] = True

                graph[edge[j][1]-1][edge[j][0]-1] = True

        dfs(0)

        if visted != [True] * n:

            ans += 1



    print((str(ans)))

from collections import deque



if __name__ == "__main__":

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

    edge = list()

    for i in range(m):

        edge.append(list(map(int, input().split())))



    ans = 0



    for i in range(m):

        distance = [-1] * n

        que = deque([0])

        graph = dict()

        for j in range(n):

            graph[j] = []



        distance[0] = 0  # 初期条件(スタート地点)



        for j in range(m):

            if i != j:

                graph[edge[j][0]-1].append(edge[j][1]-1)

                graph[edge[j][1]-1].append(edge[j][0]-1)



        # 幅優先探索

        while len(que) != 0:

            v = que.popleft()

            for g in graph[v]:

                if distance[g] != -1:

                    continue

                distance[g] = distance[v] + 1

                que.append(g)



        for d in distance:

            if d == -1:

                ans += 1

                break



    print((str(ans)))

if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    edge = list()
    for i in range(m):
        edge.append(list(map(int, input().split())))
    ans = 0

    def dfs(v):
        visted[v] = True
        for i in range(n):
            if graph[v][i] is False:
                continue
            if visted[i] is True:
                continue
            dfs(i)

    for i in range(m):
        visted = [False] * n
        graph = [[False] * n for _ in range(n)]
        for j in range(m):
            if i != j:
                graph[edge[j][0] - 1][edge[j][1] - 1] = True
                graph[edge[j][1] - 1][edge[j][0] - 1] = True
        dfs(0)
        if visted != [True] * n:
            ans += 1
    print((str(ans)))

from collections import deque

if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    edge = list()
    for i in range(m):
        edge.append(list(map(int, input().split())))
    ans = 0
    for i in range(m):
        distance = [-1] * n
        que = deque([0])
        graph = dict()
        for j in range(n):
            graph[j] = []
        distance[0] = 0  # 初期条件(スタート地点)
        for j in range(m):
            if i != j:
                graph[edge[j][0] - 1].append(edge[j][1] - 1)
                graph[edge[j][1] - 1].append(edge[j][0] - 1)
        # 幅優先探索
        while len(que) != 0:
            v = que.popleft()
            for g in graph[v]:
                if distance[g] != -1:
                    continue
                distance[g] = distance[v] + 1
                que.append(g)
        for d in distance:
            if d == -1:
                ans += 1
                break
    print((str(ans)))

+from collections import deque + - -    def dfs(v): -        visted[v] = True -        for i in range(n): -            if graph[v][i] is False: -                continue -            if visted[i] is True: -                continue -            dfs(i) - -        visted = [False] * n -        graph = [[False] * n for _ in range(n)] +        distance = [-1] * n +        que = deque([0]) +        graph = dict() +        for j in range(n): +            graph[j] = [] +        distance[0] = 0  # 初期条件(スタート地点) -                graph[edge[j][0] - 1][edge[j][1] - 1] = True -                graph[edge[j][1] - 1][edge[j][0] - 1] = True -        dfs(0) -        if visted != [True] * n: -            ans += 1 +                graph[edge[j][0] - 1].append(edge[j][1] - 1) +                graph[edge[j][1] - 1].append(edge[j][0] - 1) +        # 幅優先探索 +        while len(que) != 0: +            v = que.popleft() +            for g in graph[v]: +                if distance[g] != -1: +                    continue +                distance[g] = distance[v] + 1 +                que.append(g) +        for d in distance: +            if d == -1: +                ans += 1 +                break