

class UnionFind:

    def __init__(self, size):

        self.table = [i for i in range(size)]



    def find(self, x):

        return self.table[x]



    def union(self, x, y):

        x1 = self.find(x)

        y1 = self.find(y)



        if x1 == y1:

            return False



        for i in range(len(self.table)):

            if self.table[i] == y1:

                self.table[i] = x1

        return True





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



edges = []

for _ in range(M):

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

    edges.append([a-1, b-1])



mat = [[0]*N for _ in range(N)]

for s, g in edges:

    mat[s][g] = 1

    mat[g][s] = 1



ans = 0



for i in range(M):

    uni = UnionFind(N)



    for j in range(M):

        if i != j:

            uni.union(edges[j][0], edges[j][1])



    if not all(uni.find(0) == uni.find(x) for x in range(N)):

        ans += 1

print(ans)

# python template for atcoder1

import sys

sys.setrecursionlimit(10**9)

input = sys.stdin.readline





class UnionFind:

    def __init__(self, size):

        """

        size:頂点の数

        """

        self.parent = [i for i in range(size)]

        self.rank = [0 for _ in range(size)]



    def find(self, x):

        """

        xのrootを返す

        """

        if self.parent[x] == x:

            return x

        else:

            return self.find(self.parent[x])



    def union(self, x, y):

        """

        x,yを同じグループとしてまとめる

        """

        x = self.find(x)

        y = self.find(y)

        if x == y:

            return



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

            self.parent[x] = y

        else:

            self.parent[y] = x

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

                self.rank[x] += 1



    def same(self, x, y):

        """

        xとyが同じグループならTrue

        """

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



    def component(self):

        """

        各連結成分のrootの集合を返す

        len()をとれば連結成分の数が求められる

        return-> set()

        """

        comp = set()

        for i in self.parent:

            p = self.find(i)

            comp.add(p)

        return comp



    def __str__(self):

        """

        for debug

        クラスのlistの情報を出力

        """

        ret = "parents\n"

        ret += " ".join(map(str, self.parent))

        ret += '\n'

        ret += " ".join(map(str, self.rank))

        return ret





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

edges = []



for _ in range(M):

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

    edges.append([a, b])



ans = 0

for e in edges:

    Un = UnionFind(N)

    for g in edges:

        if e == g:

            continue

        else:

            Un.union(g[0], g[1])

    if not Un.same(e[0], e[1]):

        ans += 1

print(ans)

class UnionFind:
    def __init__(self, size):
        self.table = [i for i in range(size)]

    def find(self, x):
        return self.table[x]

    def union(self, x, y):
        x1 = self.find(x)
        y1 = self.find(y)
        if x1 == y1:
            return False
        for i in range(len(self.table)):
            if self.table[i] == y1:
                self.table[i] = x1
        return True


N, M = list(map(int, input().split()))
edges = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.append([a - 1, b - 1])
mat = [[0] * N for _ in range(N)]
for s, g in edges:
    mat[s][g] = 1
    mat[g][s] = 1
ans = 0
for i in range(M):
    uni = UnionFind(N)
    for j in range(M):
        if i != j:
            uni.union(edges[j][0], edges[j][1])
    if not all(uni.find(0) == uni.find(x) for x in range(N)):
        ans += 1
print(ans)

# python template for atcoder1
import sys

sys.setrecursionlimit(10**9)
input = sys.stdin.readline


class UnionFind:
    def __init__(self, size):
        """
        size:頂点の数
        """
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]

    def find(self, x):
        """
        xのrootを返す
        """
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])

    def union(self, x, y):
        """
        x,yを同じグループとしてまとめる
        """
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        """
        xとyが同じグループならTrue
        """
        return self.find(x) == self.find(y)

    def component(self):
        """
        各連結成分のrootの集合を返す
        len()をとれば連結成分の数が求められる
        return-> set()
        """
        comp = set()
        for i in self.parent:
            p = self.find(i)
            comp.add(p)
        return comp

    def __str__(self):
        """
        for debug
        クラスのlistの情報を出力
        """
        ret = "parents\n"
        ret += " ".join(map(str, self.parent))
        ret += "\n"
        ret += " ".join(map(str, self.rank))
        return ret


N, M = list(map(int, input().split()))
edges = []
for _ in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    edges.append([a, b])
ans = 0
for e in edges:
    Un = UnionFind(N)
    for g in edges:
        if e == g:
            continue
        else:
            Un.union(g[0], g[1])
    if not Un.same(e[0], e[1]):
        ans += 1
print(ans)

+# python template for atcoder1 +import sys + +sys.setrecursionlimit(10**9) +input = sys.stdin.readline + + -        self.table = [i for i in range(size)] +        """ +        size:頂点の数 +        """ +        self.parent = [i for i in range(size)] +        self.rank = [0 for _ in range(size)] -        return self.table[x] +        """ +        xのrootを返す +        """ +        if self.parent[x] == x: +            return x +        else: +            return self.find(self.parent[x]) -        x1 = self.find(x) -        y1 = self.find(y) -        if x1 == y1: -            return False -        for i in range(len(self.table)): -            if self.table[i] == y1: -                self.table[i] = x1 -        return True +        """ +        x,yを同じグループとしてまとめる +        """ +        x = self.find(x) +        y = self.find(y) +        if x == y: +            return +        if self.rank[x] < self.rank[y]: +            self.parent[x] = y +        else: +            self.parent[y] = x +            if self.rank[x] == self.rank[y]: +                self.rank[x] += 1 + +    def same(self, x, y): +        """ +        xとyが同じグループならTrue +        """ +        return self.find(x) == self.find(y) + +    def component(self): +        """ +        各連結成分のrootの集合を返す +        len()をとれば連結成分の数が求められる +        return-> set() +        """ +        comp = set() +        for i in self.parent: +            p = self.find(i) +            comp.add(p) +        return comp + +    def __str__(self): +        """ +        for debug +        クラスのlistの情報を出力 +        """ +        ret = "parents\n" +        ret += " ".join(map(str, self.parent)) +        ret += "\n" +        ret += " ".join(map(str, self.rank)) +        return ret -    a, b = list(map(int, input().split())) -    edges.append([a - 1, b - 1]) -mat = [[0] * N for _ in range(N)] -for s, g in edges: -    mat[s][g] = 1 -    mat[g][s] = 1 +    a, b = [int(x) - 1 for x in input().split()] +    edges.append([a, b]) -for i in range(M): -    uni = UnionFind(N) -    for j in range(M): -        if i != j: -            uni.union(edges[j][0], edges[j][1]) -    if not all(uni.find(0) == uni.find(x) for x in range(N)): +for e in edges: +    Un = UnionFind(N) +    for g in edges: +        if e == g: +            continue +        else: +            Un.union(g[0], g[1]) +    if not Un.same(e[0], e[1]):