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



brides = []

for _ in range(m):

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

    brides.append((a, b))





class Union:

    def __init__(self, val):

        self.val = val

        self.parent = self

        self.rank = 0



    def get_root(self):

        n = self

        while n.parent != n:

            n = n.parent

        return n



    def find_set(self):

        return self.get_root().val



ans = 0

for i in range(m):

    unions = []

    for val in range(n):

        unions.append(Union(val))

    for index, (a, b) in enumerate(brides):

        if i == index:

            continue

        x, y = unions[a - 1], unions[b - 1]

        x_root = x.get_root()

        y_root = y.get_root()

        if x_root.rank == y_root.rank:

            x_root.rank += 1

            y_root.parent = x_root

        elif x_root.rank > y_root.rank:

            y_root.parent = x_root

        else:

            x_root.parent = y_root



    groups = [None] * n

    for j, u in enumerate(unions):

        root = u.find_set()

        groups[j] = root

    for g in range(1, n):

        if groups[g - 1] != groups[g]:

            ans += 1

            break

print(ans)
# https://atcoder.jp/contests/abc075/tasks/abc075_c

# 各頂点を結ぶクエリー(a, bの情報)ごとに、

# それを実行しなくてもたどり着ける頂点が総頂点数(n)に一致するかを判定する。

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



queries = []

for _ in range(m):

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

    queries.append((a, b))



def dfs(graph, n):

    visited = [False] * (n + 1)

    visited[0] = True # 1-indexedなので、0番目は関係ない

    stack = [1]

    num = 0

    while stack:

        t = stack.pop()

        for node in graph[t]:

            if visited[node]:

                continue

            visited[node] = True

            stack.append(node)

            num += 1

    if num == n:

        return True

    return False



ans = 0

for i in range(m):

    graph = [[] for _ in range(n + 1)]

    for j in range(m):

        if i == j:

            continue

        a, b = queries[j]

        graph[a].append(b)

        graph[b].append(a)

    if not dfs(graph, n):

        ans += 1

print(ans)
n, m = list(map(int, input().split()))
brides = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    brides.append((a, b))


class Union:
    def __init__(self, val):
        self.val = val
        self.parent = self
        self.rank = 0

    def get_root(self):
        n = self
        while n.parent != n:
            n = n.parent
        return n

    def find_set(self):
        return self.get_root().val


ans = 0
for i in range(m):
    unions = []
    for val in range(n):
        unions.append(Union(val))
    for index, (a, b) in enumerate(brides):
        if i == index:
            continue
        x, y = unions[a - 1], unions[b - 1]
        x_root = x.get_root()
        y_root = y.get_root()
        if x_root.rank == y_root.rank:
            x_root.rank += 1
            y_root.parent = x_root
        elif x_root.rank > y_root.rank:
            y_root.parent = x_root
        else:
            x_root.parent = y_root
    groups = [None] * n
    for j, u in enumerate(unions):
        root = u.find_set()
        groups[j] = root
    for g in range(1, n):
        if groups[g - 1] != groups[g]:
            ans += 1
            break
print(ans)

# https://atcoder.jp/contests/abc075/tasks/abc075_c
# 各頂点を結ぶクエリー(a, bの情報)ごとに、
# それを実行しなくてもたどり着ける頂点が総頂点数(n)に一致するかを判定する。
n, m = list(map(int, input().split()))
queries = []
for _ in range(m):
    a, b = list(map(int, input().split()))
    queries.append((a, b))


def dfs(graph, n):
    visited = [False] * (n + 1)
    visited[0] = True  # 1-indexedなので、0番目は関係ない
    stack = [1]
    num = 0
    while stack:
        t = stack.pop()
        for node in graph[t]:
            if visited[node]:
                continue
            visited[node] = True
            stack.append(node)
            num += 1
    if num == n:
        return True
    return False


ans = 0
for i in range(m):
    graph = [[] for _ in range(n + 1)]
    for j in range(m):
        if i == j:
            continue
        a, b = queries[j]
        graph[a].append(b)
        graph[b].append(a)
    if not dfs(graph, n):
        ans += 1
print(ans)

+# https://atcoder.jp/contests/abc075/tasks/abc075_c +# 各頂点を結ぶクエリー(a, bの情報)ごとに、 +# それを実行しなくてもたどり着ける頂点が総頂点数(n)に一致するかを判定する。 -brides = [] +queries = [] -    brides.append((a, b)) +    queries.append((a, b)) -class Union: -    def __init__(self, val): -        self.val = val -        self.parent = self -        self.rank = 0 - -    def get_root(self): -        n = self -        while n.parent != n: -            n = n.parent -        return n - -    def find_set(self): -        return self.get_root().val +def dfs(graph, n): +    visited = [False] * (n + 1) +    visited[0] = True  # 1-indexedなので、0番目は関係ない +    stack = [1] +    num = 0 +    while stack: +        t = stack.pop() +        for node in graph[t]: +            if visited[node]: +                continue +            visited[node] = True +            stack.append(node) +            num += 1 +    if num == n: +        return True +    return False -    unions = [] -    for val in range(n): -        unions.append(Union(val)) -    for index, (a, b) in enumerate(brides): -        if i == index: +    graph = [[] for _ in range(n + 1)] +    for j in range(m): +        if i == j: -        x, y = unions[a - 1], unions[b - 1] -        x_root = x.get_root() -        y_root = y.get_root() -        if x_root.rank == y_root.rank: -            x_root.rank += 1 -            y_root.parent = x_root -        elif x_root.rank > y_root.rank: -            y_root.parent = x_root -        else: -            x_root.parent = y_root -    groups = [None] * n -    for j, u in enumerate(unions): -        root = u.find_set() -        groups[j] = root -    for g in range(1, n): -        if groups[g - 1] != groups[g]: -            ans += 1 -            break +        a, b = queries[j] +        graph[a].append(b) +        graph[b].append(a) +    if not dfs(graph, n): +        ans += 1