from collections import Counter





class UnionFind:

    def __init__(self, n):

        self.root = list(range(n + 1))

        self.size = [1] * (n + 1)



    def __getitem__(self, x):

        root = self.root

        while root[x] != x:

            root[x] = root[root[x]]

            x = root[x]

        return x



    def merge(self, x, y):

        x = self[x]

        y = self[y]

        if x == y:

            return

        sx, sy = self.size[x], self.size[y]

        if sx < sy:

            x, y = y, x

            sx, sy = sy, sx

        self.root[y] = x

        self.size[x] += sy





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

A = []

B = []



for i in range(M):

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

    A.append(a)

    B.append(b)





res = 0

for i in range(M):

    uni = UnionFind(N)

    for j in range(M):

        if j == i:

            continue

        else:

            uni.merge(A[j], B[j])

    # uniの連結成分を数える

    roots = [uni[x] for x in uni.root[1:]]

    counter = Counter(roots)

    if len(counter) > 1:

        res += 1



print(res)
from collections import Counter

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



class UnionFind:

    def __init__(self, N):

        self.root = list(range(N + 1))

        self.size = [1] * (N + 1)



    def __getitem__(self, x):

        root = self.root

        while root[x] != x:

            root[x] = root[root[x]]

            x = root[x]

        return x



    def merge(self, x, y):

        x = self[x]

        y = self[y]

        if x == y:

            return

        sx, sy = self.size[x], self.size[y]

        if sx < sy:

            x, y = y, x

            sx, sy = sy, sx

        self.root[y] = x

        self.size[x] += sy





A, B = [], []

for i in range(M):

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

    A.append(a)

    B.append(b)



count = 0

for i in range(M):

    uni = UnionFind(N)

    for j in range(M):

        if j == i:

            continue

        uni.merge(A[j], B[j])

    # UnionFindの連結成分の個数を数える

    roots = [uni[x] for x in uni.root[1:]]

    counter = Counter(roots)

    if len(counter) > 1:

        count += 1



print(count)
from collections import Counter


class UnionFind:
    def __init__(self, n):
        self.root = list(range(n + 1))
        self.size = [1] * (n + 1)

    def __getitem__(self, x):
        root = self.root
        while root[x] != x:
            root[x] = root[root[x]]
            x = root[x]
        return x

    def merge(self, x, y):
        x = self[x]
        y = self[y]
        if x == y:
            return
        sx, sy = self.size[x], self.size[y]
        if sx < sy:
            x, y = y, x
            sx, sy = sy, sx
        self.root[y] = x
        self.size[x] += sy


N, M = list(map(int, input().split()))
A = []
B = []
for i in range(M):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
res = 0
for i in range(M):
    uni = UnionFind(N)
    for j in range(M):
        if j == i:
            continue
        else:
            uni.merge(A[j], B[j])
    # uniの連結成分を数える
    roots = [uni[x] for x in uni.root[1:]]
    counter = Counter(roots)
    if len(counter) > 1:
        res += 1
print(res)

from collections import Counter

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


class UnionFind:
    def __init__(self, N):
        self.root = list(range(N + 1))
        self.size = [1] * (N + 1)

    def __getitem__(self, x):
        root = self.root
        while root[x] != x:
            root[x] = root[root[x]]
            x = root[x]
        return x

    def merge(self, x, y):
        x = self[x]
        y = self[y]
        if x == y:
            return
        sx, sy = self.size[x], self.size[y]
        if sx < sy:
            x, y = y, x
            sx, sy = sy, sx
        self.root[y] = x
        self.size[x] += sy


A, B = [], []
for i in range(M):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
count = 0
for i in range(M):
    uni = UnionFind(N)
    for j in range(M):
        if j == i:
            continue
        uni.merge(A[j], B[j])
    # UnionFindの連結成分の個数を数える
    roots = [uni[x] for x in uni.root[1:]]
    counter = Counter(roots)
    if len(counter) > 1:
        count += 1
print(count)

+ +N, M = list(map(int, input().split())) -    def __init__(self, n): -        self.root = list(range(n + 1)) -        self.size = [1] * (n + 1) +    def __init__(self, N): +        self.root = list(range(N + 1)) +        self.size = [1] * (N + 1) -N, M = list(map(int, input().split())) -A = [] -B = [] +A, B = [], [] -res = 0 +count = 0 -        else: -            uni.merge(A[j], B[j]) -    # uniの連結成分を数える +        uni.merge(A[j], B[j]) +    # UnionFindの連結成分の個数を数える -        res += 1 -print(res) +        count += 1 +print(count)