#!/usr/bin/env python3



from pprint import pprint

from collections import deque, defaultdict

import itertools

import math

import sys



sys.setrecursionlimit(10 ** 6)

input = sys.stdin.buffer.readline

INF = float('inf')



n_nodes, m_edges = list(map(int, input().split()))

edges = []

for _ in range(m_edges):

    u, v = list(map(int, input().split()))

    edges.append([u - 1, v - 1])

# pprint(edges)





def find_root(v):

    if v != parents[v]:

        parents[v] = find_root(parents[v])

    return parents[v]





def has_same_root(u, v):

    return find_root(u) == find_root(v)





def unite(u, v):

    root_u, root_v = find_root(u), find_root(v)

    if root_u == root_v:

        return

    if rank[root_u] < rank[root_v]:

        root_u, root_v = root_v, root_u

    parents[root_v] = root_u

    rank[root_u] += rank[root_v]





res = 0

for i in range(m_edges):

    parents = [i for i in range(n_nodes)]

    rank = [1] * n_nodes

    for j in range(m_edges):

        if i == j:

            continue

        u, v = edges[j]

        if not has_same_root(u, v):

            unite(u, v)

    # pprint(parents)

    count = 0

    for v in range(n_nodes):

        if parents[v] == v:

            count += 1

    if count > 1:

        res += 1



print(res)

#!/usr/bin/env python3



from pprint import pprint

import sys



sys.setrecursionlimit(10 ** 6)

INF = float('inf')





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



edges = []

for _ in range(M):

    u, v = list(map(int, input().split()))

    edges.append([u-1, v-1])

# pprint(edges)





# ある辺iを除いた残りの辺にそれぞれに対してuniteの操作を行ったのち、異なるparentsの数を数える

# 連結グラフであれば、異なるparentsの数は1になる

# 非連結グラフであれば、異なるparentsの数は2以上になる





def root(v):

    if parents[v] == v:

        return v

    parents[v] = root(parents[v])

    return parents[v]





def unite(u, v):

    u_root = root(u)

    v_root = root(v)

    if u_root == v_root:

        return

    parents[u_root] = v_root





def same(u, v):

    return root(u) == root(v)





ans = 0

for e_i in edges:

    parents = [i for i in range(N)]

    for e_j in edges:

        if e_i == e_j:

            continue

        u, v = e_j

        if not same(u, v):

            unite(u, v)

    count = 0

    for v in range(N):

        if parents[v] == v:

            count += 1

    if count > 1:

        ans += 1



print(ans)

#!/usr/bin/env python3
from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = float("inf")
n_nodes, m_edges = list(map(int, input().split()))
edges = []
for _ in range(m_edges):
    u, v = list(map(int, input().split()))
    edges.append([u - 1, v - 1])
# pprint(edges)
def find_root(v):
    if v != parents[v]:
        parents[v] = find_root(parents[v])
    return parents[v]


def has_same_root(u, v):
    return find_root(u) == find_root(v)


def unite(u, v):
    root_u, root_v = find_root(u), find_root(v)
    if root_u == root_v:
        return
    if rank[root_u] < rank[root_v]:
        root_u, root_v = root_v, root_u
    parents[root_v] = root_u
    rank[root_u] += rank[root_v]


res = 0
for i in range(m_edges):
    parents = [i for i in range(n_nodes)]
    rank = [1] * n_nodes
    for j in range(m_edges):
        if i == j:
            continue
        u, v = edges[j]
        if not has_same_root(u, v):
            unite(u, v)
    # pprint(parents)
    count = 0
    for v in range(n_nodes):
        if parents[v] == v:
            count += 1
    if count > 1:
        res += 1
print(res)

#!/usr/bin/env python3
from pprint import pprint
import sys

sys.setrecursionlimit(10**6)
INF = float("inf")
N, M = list(map(int, input().split()))
edges = []
for _ in range(M):
    u, v = list(map(int, input().split()))
    edges.append([u - 1, v - 1])
# pprint(edges)
# ある辺iを除いた残りの辺にそれぞれに対してuniteの操作を行ったのち、異なるparentsの数を数える
# 連結グラフであれば、異なるparentsの数は1になる
# 非連結グラフであれば、異なるparentsの数は2以上になる
def root(v):
    if parents[v] == v:
        return v
    parents[v] = root(parents[v])
    return parents[v]


def unite(u, v):
    u_root = root(u)
    v_root = root(v)
    if u_root == v_root:
        return
    parents[u_root] = v_root


def same(u, v):
    return root(u) == root(v)


ans = 0
for e_i in edges:
    parents = [i for i in range(N)]
    for e_j in edges:
        if e_i == e_j:
            continue
        u, v = e_j
        if not same(u, v):
            unite(u, v)
    count = 0
    for v in range(N):
        if parents[v] == v:
            count += 1
    if count > 1:
        ans += 1
print(ans)

-from collections import deque, defaultdict -import itertools -import math -input = sys.stdin.buffer.readline -n_nodes, m_edges = list(map(int, input().split())) +N, M = list(map(int, input().split())) -for _ in range(m_edges): +for _ in range(M): -def find_root(v): -    if v != parents[v]: -        parents[v] = find_root(parents[v]) +# ある辺iを除いた残りの辺にそれぞれに対してuniteの操作を行ったのち、異なるparentsの数を数える +# 連結グラフであれば、異なるparentsの数は1になる +# 非連結グラフであれば、異なるparentsの数は2以上になる +def root(v): +    if parents[v] == v: +        return v +    parents[v] = root(parents[v]) -def has_same_root(u, v): -    return find_root(u) == find_root(v) +def unite(u, v): +    u_root = root(u) +    v_root = root(v) +    if u_root == v_root: +        return +    parents[u_root] = v_root -def unite(u, v): -    root_u, root_v = find_root(u), find_root(v) -    if root_u == root_v: -        return -    if rank[root_u] < rank[root_v]: -        root_u, root_v = root_v, root_u -    parents[root_v] = root_u -    rank[root_u] += rank[root_v] +def same(u, v): +    return root(u) == root(v) -res = 0 -for i in range(m_edges): -    parents = [i for i in range(n_nodes)] -    rank = [1] * n_nodes -    for j in range(m_edges): -        if i == j: +ans = 0 +for e_i in edges: +    parents = [i for i in range(N)] +    for e_j in edges: +        if e_i == e_j: -        u, v = edges[j] -        if not has_same_root(u, v): +        u, v = e_j +        if not same(u, v): -    # pprint(parents) -    for v in range(n_nodes): +    for v in range(N): -        res += 1 -print(res) +        ans += 1 +print(ans)