import sys

import copy



readline = sys.stdin.readline



def dfs(p, x):

    global graphtmp, check

    to = graphtmp[x]

    check[x] = 1

    for t in to:

        if p == t or check[t] == 1:

            continue

        dfs(x, t)



def main():

    global graphtmp, check

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

    graph = [[] for _ in range(N)]

    nodelist = []

    for _ in range(M):

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

        a -= 1; b-= 1

        nodelist.append([a, b])

        graph[a].append(b)

        graph[b].append(a)

    

    ans = 0

    for nodetmp in nodelist:

        check = [0]*N

        graphtmp = copy.deepcopy(graph)

        graphtmp[nodetmp[0]].remove(nodetmp[1])

        graphtmp[nodetmp[1]].remove(nodetmp[0])

        dfs(-1, 0)

        if 0 in check:

            ans += 1

    print(ans)





if __name__ == "__main__":

    main()

import sys



readline = sys.stdin.readline



class UnionFind():

    def __init__(self, n):

        self.n = n

        self.parents = [-1] * n

        self.rank = [0] * n

    

    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

            self.parents[x] = self.find(self.parents[x])

            return self.parents[x]

    

    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)



        if x == y:

            return

        

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

            self.parents[x] = y

        else:

            self.parents[y] = x

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

                self.rank[x] += 1



def main():

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

    nodelist = []

    for _ in range(M):

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

        a -= 1; b -= 1

        nodelist.append([a, b])



    ans = 0

    for i in range(M):

        uf = UnionFind(N)

        for j, node in enumerate(nodelist):

            if j == i:

                continue

            uf.union(node[0], node[1])

        parent = []

        for k in range(N):

            parent.append(uf.find(k))

        if len(set(parent)) > 1:

            ans += 1

    print(ans)





if __name__ == "__main__":

    main()

import sys
import copy

readline = sys.stdin.readline


def dfs(p, x):
    global graphtmp, check
    to = graphtmp[x]
    check[x] = 1
    for t in to:
        if p == t or check[t] == 1:
            continue
        dfs(x, t)


def main():
    global graphtmp, check
    N, M = list(map(int, readline().split()))
    graph = [[] for _ in range(N)]
    nodelist = []
    for _ in range(M):
        a, b = list(map(int, readline().split()))
        a -= 1
        b -= 1
        nodelist.append([a, b])
        graph[a].append(b)
        graph[b].append(a)
    ans = 0
    for nodetmp in nodelist:
        check = [0] * N
        graphtmp = copy.deepcopy(graph)
        graphtmp[nodetmp[0]].remove(nodetmp[1])
        graphtmp[nodetmp[1]].remove(nodetmp[0])
        dfs(-1, 0)
        if 0 in check:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

import sys

readline = sys.stdin.readline


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
        self.rank = [0] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parents[x] = y
        else:
            self.parents[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1


def main():
    N, M = list(map(int, readline().split()))
    nodelist = []
    for _ in range(M):
        a, b = list(map(int, readline().split()))
        a -= 1
        b -= 1
        nodelist.append([a, b])
    ans = 0
    for i in range(M):
        uf = UnionFind(N)
        for j, node in enumerate(nodelist):
            if j == i:
                continue
            uf.union(node[0], node[1])
        parent = []
        for k in range(N):
            parent.append(uf.find(k))
        if len(set(parent)) > 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-import copy -def dfs(p, x): -    global graphtmp, check -    to = graphtmp[x] -    check[x] = 1 -    for t in to: -        if p == t or check[t] == 1: -            continue -        dfs(x, t) +class UnionFind: +    def __init__(self, n): +        self.n = n +        self.parents = [-1] * n +        self.rank = [0] * n + +    def find(self, x): +        if self.parents[x] < 0: +            return x +        else: +            self.parents[x] = self.find(self.parents[x]) +            return self.parents[x] + +    def union(self, x, y): +        x = self.find(x) +        y = self.find(y) +        if x == y: +            return +        if self.rank[x] < self.rank[y]: +            self.parents[x] = y +        else: +            self.parents[y] = x +            if self.rank[x] == self.rank[y]: +                self.rank[x] += 1 -    global graphtmp, check -    graph = [[] for _ in range(N)] -        graph[a].append(b) -        graph[b].append(a) -    for nodetmp in nodelist: -        check = [0] * N -        graphtmp = copy.deepcopy(graph) -        graphtmp[nodetmp[0]].remove(nodetmp[1]) -        graphtmp[nodetmp[1]].remove(nodetmp[0]) -        dfs(-1, 0) -        if 0 in check: +    for i in range(M): +        uf = UnionFind(N) +        for j, node in enumerate(nodelist): +            if j == i: +                continue +            uf.union(node[0], node[1]) +        parent = [] +        for k in range(N): +            parent.append(uf.find(k)) +        if len(set(parent)) > 1: