from collections import deque

from copy import deepcopy



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

Matrix = [[False for x in range(N)] for y in range(N)]



Path = []

for i in range(M) :

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

    a -= 1

    b -= 1

    Path.append((a,b))

    Matrix[a][b] = True

    Matrix[b][a] = True



ans = 0

for i in range(M) :

    Matrix_duplicated = deepcopy(Matrix)

    a,b = Path[i]

    Matrix_duplicated[a][b] = False

    Matrix_duplicated[b][a] = False

    Visited = []

    Queue = deque([0])

    while Queue :

        now = Queue.popleft()

        Visited.append(now)

        for i in range(N) :

            if Matrix_duplicated[now][i] :

                Matrix_duplicated[now][i] = False

                Matrix_duplicated[i][now] = False

                Queue.append(i)

    if len(list(set(Visited))) != N :

        ans += 1

print(ans)

class UnionFind:

    def __init__(self, num):

        self.rank = [0] * num

        self.par = [i for i in range(num)]

        self.n = num



    def find_root(self, node):

        if self.par[node] == node:

            return node

        else:

            self.par[node] = self.find_root(self.par[node])

            return self.par[node]



    def same_root(self, x, y):

        return self.find_root(x) == self.find_root(y)



    def union(self, x, y):

        x = self.find_root(x)

        y = self.find_root(y)

        if x == y:

            return

        if self.rank[x] > self.rank[y]:

            self.par[y] = x

        else:

            self.par[x] = y

            if self.rank[x] == self.rank[y]:

                self.rank[y] += 1





def main():

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

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

    for i in range(M) :

        L[i][0] -= 1

        L[i][1] -= 1

    

    ans = 0

    

    for i in range(M) :

        UF = UnionFind(N)

        for j in range(M) :

            if j == i :

                continue

            UF.union(L[j][0], L[j][1])

        

        ans += (UF.same_root(L[i][0], L[i][1]) == False)

    

    print(ans)



import sys

input = sys.stdin.readline



if __name__ == "__main__":

    main()

from collections import deque
from copy import deepcopy

N, M = list(map(int, input().split()))
Matrix = [[False for x in range(N)] for y in range(N)]
Path = []
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    Path.append((a, b))
    Matrix[a][b] = True
    Matrix[b][a] = True
ans = 0
for i in range(M):
    Matrix_duplicated = deepcopy(Matrix)
    a, b = Path[i]
    Matrix_duplicated[a][b] = False
    Matrix_duplicated[b][a] = False
    Visited = []
    Queue = deque([0])
    while Queue:
        now = Queue.popleft()
        Visited.append(now)
        for i in range(N):
            if Matrix_duplicated[now][i]:
                Matrix_duplicated[now][i] = False
                Matrix_duplicated[i][now] = False
                Queue.append(i)
    if len(list(set(Visited))) != N:
        ans += 1
print(ans)

class UnionFind:
    def __init__(self, num):
        self.rank = [0] * num
        self.par = [i for i in range(num)]
        self.n = num

    def find_root(self, node):
        if self.par[node] == node:
            return node
        else:
            self.par[node] = self.find_root(self.par[node])
            return self.par[node]

    def same_root(self, x, y):
        return self.find_root(x) == self.find_root(y)

    def union(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return
        if self.rank[x] > self.rank[y]:
            self.par[y] = x
        else:
            self.par[x] = y
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1


def main():
    N, M = list(map(int, input().split()))
    L = [list(map(int, input().split())) for i in range(M)]
    for i in range(M):
        L[i][0] -= 1
        L[i][1] -= 1
    ans = 0
    for i in range(M):
        UF = UnionFind(N)
        for j in range(M):
            if j == i:
                continue
            UF.union(L[j][0], L[j][1])
        ans += UF.same_root(L[i][0], L[i][1]) == False
    print(ans)


import sys

input = sys.stdin.readline
if __name__ == "__main__":
    main()

-from collections import deque -from copy import deepcopy +class UnionFind: +    def __init__(self, num): +        self.rank = [0] * num +        self.par = [i for i in range(num)] +        self.n = num -N, M = list(map(int, input().split())) -Matrix = [[False for x in range(N)] for y in range(N)] -Path = [] -for i in range(M): -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    Path.append((a, b)) -    Matrix[a][b] = True -    Matrix[b][a] = True -ans = 0 -for i in range(M): -    Matrix_duplicated = deepcopy(Matrix) -    a, b = Path[i] -    Matrix_duplicated[a][b] = False -    Matrix_duplicated[b][a] = False -    Visited = [] -    Queue = deque([0]) -    while Queue: -        now = Queue.popleft() -        Visited.append(now) -        for i in range(N): -            if Matrix_duplicated[now][i]: -                Matrix_duplicated[now][i] = False -                Matrix_duplicated[i][now] = False -                Queue.append(i) -    if len(list(set(Visited))) != N: -        ans += 1 -print(ans) +    def find_root(self, node): +        if self.par[node] == node: +            return node +        else: +            self.par[node] = self.find_root(self.par[node]) +            return self.par[node] + +    def same_root(self, x, y): +        return self.find_root(x) == self.find_root(y) + +    def union(self, x, y): +        x = self.find_root(x) +        y = self.find_root(y) +        if x == y: +            return +        if self.rank[x] > self.rank[y]: +            self.par[y] = x +        else: +            self.par[x] = y +            if self.rank[x] == self.rank[y]: +                self.rank[y] += 1 + + +def main(): +    N, M = list(map(int, input().split())) +    L = [list(map(int, input().split())) for i in range(M)] +    for i in range(M): +        L[i][0] -= 1 +        L[i][1] -= 1 +    ans = 0 +    for i in range(M): +        UF = UnionFind(N) +        for j in range(M): +            if j == i: +                continue +            UF.union(L[j][0], L[j][1]) +        ans += UF.same_root(L[i][0], L[i][1]) == False +    print(ans) + + +import sys + +input = sys.stdin.readline +if __name__ == "__main__": +    main()