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



es = [tuple([int(x)-1 for x in input().split()]) for _ in range(m)]



class UnionFind:

    def __init__(self, n):

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

        self.rank = [0] * n

        self.count = 0



    def root(self, x):

        if self.parent[x] == x:

            return x

        else:

            self.parent[x] = self.root(self.parent[x])

            return self.parent[x]



    def is_same(self, x, y):

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



    def unite(self, x, y):

        rx = self.root(x)

        ry = self.root(y)

        if rx == ry:

            return

        if self.rank[rx] < self.rank[ry]:

            self.parent[rx] = ry

        else:

            self.parent[ry] = rx

            if self.rank[rx] == self.rank[ry]:

                self.rank[rx] += 1

        self.count += 1





ans = 0

for i in range(m):

    uf = UnionFind(n)

    for j, (a, b) in enumerate(es):

        if i == j:

            continue # 一つ辺を外す

        if uf.is_same(a, b):

            continue # 現時点で繋がってるのでOK

        uf.unite(a, b)

    x, y = es[i]

    if not uf.is_same(x, y):

        ans += 1 # ある辺を外した時にその辺の両端のノードが同じ集合でないと繋がってないので橋といえる



print(ans)
class UnionFind:

    def __init__(self,N):

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

        self.rank = [0] * N

        self.count = 0

    def root(self,a):

        if self.parent[a] == a:

            return a

        else:

            self.parent[a] = self.root(self.parent[a])

            return self.parent[a]

    def is_same(self,a,b):

        return self.root(a) == self.root(b)

    def unite(self,a,b):

        ra = self.root(a)

        rb = self.root(b)

        if ra == rb: return

        if self.rank[ra] < self.rank[rb]:

            self.parent[ra] = rb

        else:

            self.parent[rb] = ra

            if self.rank[ra] == self.rank[rb]: self.rank[ra] += 1

        self.count += 1





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

es = []

for _ in range(M):

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

    es.append((a-1, b-1))



ans = 0

for i in range(M):

    uf = UnionFind(N)

    for j in range(M):

        if i == j:

            continue

        

        uf.unite(es[j][0], es[j][1])



    # 外した辺の両端が同じUnionでなければそれは橋

    if not uf.is_same(es[i][0], es[i][1]):

        ans += 1

        



print(ans)
n, m = list(map(int, input().split()))
es = [tuple([int(x) - 1 for x in input().split()]) for _ in range(m)]


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

    def root(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.parent[x]

    def is_same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx == ry:
            return
        if self.rank[rx] < self.rank[ry]:
            self.parent[rx] = ry
        else:
            self.parent[ry] = rx
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1
        self.count += 1


ans = 0
for i in range(m):
    uf = UnionFind(n)
    for j, (a, b) in enumerate(es):
        if i == j:
            continue  # 一つ辺を外す
        if uf.is_same(a, b):
            continue  # 現時点で繋がってるのでOK
        uf.unite(a, b)
    x, y = es[i]
    if not uf.is_same(x, y):
        ans += 1  # ある辺を外した時にその辺の両端のノードが同じ集合でないと繋がってないので橋といえる
print(ans)

class UnionFind:
    def __init__(self, N):
        self.parent = [i for i in range(N)]
        self.rank = [0] * N
        self.count = 0

    def root(self, a):
        if self.parent[a] == a:
            return a
        else:
            self.parent[a] = self.root(self.parent[a])
            return self.parent[a]

    def is_same(self, a, b):
        return self.root(a) == self.root(b)

    def unite(self, a, b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb:
            return
        if self.rank[ra] < self.rank[rb]:
            self.parent[ra] = rb
        else:
            self.parent[rb] = ra
            if self.rank[ra] == self.rank[rb]:
                self.rank[ra] += 1
        self.count += 1


N, M = list(map(int, input().split()))
es = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    es.append((a - 1, b - 1))
ans = 0
for i in range(M):
    uf = UnionFind(N)
    for j in range(M):
        if i == j:
            continue
        uf.unite(es[j][0], es[j][1])
    # 外した辺の両端が同じUnionでなければそれは橋
    if not uf.is_same(es[i][0], es[i][1]):
        ans += 1
print(ans)

-n, m = list(map(int, input().split())) -es = [tuple([int(x) - 1 for x in input().split()]) for _ in range(m)] - - -    def __init__(self, n): -        self.parent = [i for i in range(n)] -        self.rank = [0] * n +    def __init__(self, N): +        self.parent = [i for i in range(N)] +        self.rank = [0] * N -    def root(self, x): -        if self.parent[x] == x: -            return x +    def root(self, a): +        if self.parent[a] == a: +            return a -            self.parent[x] = self.root(self.parent[x]) -            return self.parent[x] +            self.parent[a] = self.root(self.parent[a]) +            return self.parent[a] -    def is_same(self, x, y): -        return self.root(x) == self.root(y) +    def is_same(self, a, b): +        return self.root(a) == self.root(b) -    def unite(self, x, y): -        rx = self.root(x) -        ry = self.root(y) -        if rx == ry: +    def unite(self, a, b): +        ra = self.root(a) +        rb = self.root(b) +        if ra == rb: -        if self.rank[rx] < self.rank[ry]: -            self.parent[rx] = ry +        if self.rank[ra] < self.rank[rb]: +            self.parent[ra] = rb -            self.parent[ry] = rx -            if self.rank[rx] == self.rank[ry]: -                self.rank[rx] += 1 +            self.parent[rb] = ra +            if self.rank[ra] == self.rank[rb]: +                self.rank[ra] += 1 +N, M = list(map(int, input().split())) +es = [] +for _ in range(M): +    a, b = list(map(int, input().split())) +    es.append((a - 1, b - 1)) -for i in range(m): -    uf = UnionFind(n) -    for j, (a, b) in enumerate(es): +for i in range(M): +    uf = UnionFind(N) +    for j in range(M): -            continue  # 一つ辺を外す -        if uf.is_same(a, b): -            continue  # 現時点で繋がってるのでOK -        uf.unite(a, b) -    x, y = es[i] -    if not uf.is_same(x, y): -        ans += 1  # ある辺を外した時にその辺の両端のノードが同じ集合でないと繋がってないので橋といえる +            continue +        uf.unite(es[j][0], es[j][1]) +    # 外した辺の両端が同じUnionでなければそれは橋 +    if not uf.is_same(es[i][0], es[i][1]): +        ans += 1