'''

ABC 075

https://www.youtube.com/watch?v=VJntQuR2zNI



'''

def inpl(): return input().split()

def arr(r, c): return [[False for x in range(c)] for y in range(r)]



def dfs(x):

    if vis[x]:

        return

    else:

        vis[x] = True

        for i in range(n):

            if graph[x][i]:

                dfs(i)



if __name__ == '__main__':

    n, m = list(map(int, inpl()))

    M = [list(map(int, inpl())) for _ in range(m)]



    ans = 0

    for e in range(m):#e:取り除く辺    

        graph = arr(n, n)#arr(i, j): i, j間に辺があればTrue

        for i in range(m):

            if i == e:

                continue

            a, b = M[i]

            #inputは1インデックス

            #graphは0インデックスなので、1減

            graph[a - 1][b - 1] = True

            graph[b - 1][a - 1] = True



        vis = [False for _ in range(n)]#訪れていたらTrue

        dfs(0)#0から辿れる範囲をvis = Trueにする

        

        connected = True

        for i in range(n):

            if not vis[i]:

                connected = False

                break

        if not connected:

            ans += 1

    print(ans)
def main():

    from collections import deque



    def traversal(ignore_idx):

        s = 0

        visited = [-1] * N

        visited[s] = 0



        dq = deque([s])

        while dq:

            v = dq.popleft()

            for u, edge_idx in g[v]:

                if ~visited[u] or edge_idx == ignore_idx:

                    continue

                dq.append(u)

                visited[u] = 0

        return all(~flg for flg in visited)  # 連結ならTrue



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

    g = tuple(set() for _ in range(N))

    for edge_idx in range(M):

        a, b = (int(x) - 1 for x in input().split())

        g[a].add((b, edge_idx))

        g[b].add((a, edge_idx))



    ret = 0

    for ignore_idx in range(M):

        res = traversal(ignore_idx)

        if not res:

            ret += 1

    print(ret)





if __name__ == '__main__':

    main()

"""
ABC 075
https://www.youtube.com/watch?v=VJntQuR2zNI
"""


def inpl():
    return input().split()


def arr(r, c):
    return [[False for x in range(c)] for y in range(r)]


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


if __name__ == "__main__":
    n, m = list(map(int, inpl()))
    M = [list(map(int, inpl())) for _ in range(m)]
    ans = 0
    for e in range(m):  # e:取り除く辺
        graph = arr(n, n)  # arr(i, j): i, j間に辺があればTrue
        for i in range(m):
            if i == e:
                continue
            a, b = M[i]
            # inputは1インデックス
            # graphは0インデックスなので、1減
            graph[a - 1][b - 1] = True
            graph[b - 1][a - 1] = True
        vis = [False for _ in range(n)]  # 訪れていたらTrue
        dfs(0)  # 0から辿れる範囲をvis = Trueにする
        connected = True
        for i in range(n):
            if not vis[i]:
                connected = False
                break
        if not connected:
            ans += 1
    print(ans)

def main():
    from collections import deque

    def traversal(ignore_idx):
        s = 0
        visited = [-1] * N
        visited[s] = 0
        dq = deque([s])
        while dq:
            v = dq.popleft()
            for u, edge_idx in g[v]:
                if ~visited[u] or edge_idx == ignore_idx:
                    continue
                dq.append(u)
                visited[u] = 0
        return all(~flg for flg in visited)  # 連結ならTrue

    N, M = list(map(int, input().split()))
    g = tuple(set() for _ in range(N))
    for edge_idx in range(M):
        a, b = (int(x) - 1 for x in input().split())
        g[a].add((b, edge_idx))
        g[b].add((a, edge_idx))
    ret = 0
    for ignore_idx in range(M):
        res = traversal(ignore_idx)
        if not res:
            ret += 1
    print(ret)


if __name__ == "__main__":
    main()

-""" -ABC 075 -https://www.youtube.com/watch?v=VJntQuR2zNI -""" +def main(): +    from collections import deque +    def traversal(ignore_idx): +        s = 0 +        visited = [-1] * N +        visited[s] = 0 +        dq = deque([s]) +        while dq: +            v = dq.popleft() +            for u, edge_idx in g[v]: +                if ~visited[u] or edge_idx == ignore_idx: +                    continue +                dq.append(u) +                visited[u] = 0 +        return all(~flg for flg in visited)  # 連結ならTrue -def inpl(): -    return input().split() - - -def arr(r, c): -    return [[False for x in range(c)] for y in range(r)] - - -def dfs(x): -    if vis[x]: -        return -    else: -        vis[x] = True -        for i in range(n): -            if graph[x][i]: -                dfs(i) +    N, M = list(map(int, input().split())) +    g = tuple(set() for _ in range(N)) +    for edge_idx in range(M): +        a, b = (int(x) - 1 for x in input().split()) +        g[a].add((b, edge_idx)) +        g[b].add((a, edge_idx)) +    ret = 0 +    for ignore_idx in range(M): +        res = traversal(ignore_idx) +        if not res: +            ret += 1 +    print(ret) -    n, m = list(map(int, inpl())) -    M = [list(map(int, inpl())) for _ in range(m)] -    ans = 0 -    for e in range(m):  # e:取り除く辺 -        graph = arr(n, n)  # arr(i, j): i, j間に辺があればTrue -        for i in range(m): -            if i == e: -                continue -            a, b = M[i] -            # inputは1インデックス -            # graphは0インデックスなので、1減 -            graph[a - 1][b - 1] = True -            graph[b - 1][a - 1] = True -        vis = [False for _ in range(n)]  # 訪れていたらTrue -        dfs(0)  # 0から辿れる範囲をvis = Trueにする -        connected = True -        for i in range(n): -            if not vis[i]: -                connected = False -                break -        if not connected: -            ans += 1 -    print(ans) +    main()