import copy



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

G = [[] for i in range(n)] #G(i): 頂点iと隣接する頂点のlist

a = [0] * m

b = [0] * m

for i in range(m):

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

    G[a[i]-1].append(b[i]-1) #入力は 1-indexed とする

    G[b[i]-1].append(a[i]-1) #無向グラフの場合



seen = [0] * n #頂点iが訪問済みの場合 seen[i] = 1



def dfs(g, s, t): #頂点sを始点としたDFS

    seen = [0] * n

    todo = [s]

    while(todo != []):

        v = todo.pop(len(todo)-1) #FILO

        seen[v] = 1

        for i in g[v]:

            if seen[i] == 0:

                todo.append(i)

    return seen[t]



ans = 0

for i in range(m):

    H = copy.deepcopy(G)

    H[a[i]-1].remove(b[i]-1)

    H[b[i]-1].remove(a[i]-1)

    ans += 1-dfs(H, a[i]-1, b[i]-1)



print(ans)
import sys

import copy

sys.setrecursionlimit(10000)



def root(x):

    if par[x] == x:

        return x

    else:

        par[x] = root(par[x])

        return par[x]



def unite(x, y):

    rx = root(x)

    ry = root(y)

    if rx != ry:

        par[rx] = ry



def same(x, y):

    return root(x) == root(y)





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



par = [i for i in range(n)]



a = [0] * m

b = [0] * m



for i in range(m):

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



ans = 0



for i in range(m):

    c = copy.deepcopy(a)

    d = copy.deepcopy(b)

    c = c[:i] + c[i+1:]

    d = d[:i] + d[i+1:]

    par = [i for i in range(n)]

    for j in range(m-1):

        unite(c[j]-1, d[j]-1)

    if not same(a[i]-1, b[i]-1):

        ans += 1



print(ans)
import copy

n, m = list(map(int, input().split()))
G = [[] for i in range(n)]  # G(i): 頂点iと隣接する頂点のlist
a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = list(map(int, input().split()))
    G[a[i] - 1].append(b[i] - 1)  # 入力は 1-indexed とする
    G[b[i] - 1].append(a[i] - 1)  # 無向グラフの場合
seen = [0] * n  # 頂点iが訪問済みの場合 seen[i] = 1


def dfs(g, s, t):  # 頂点sを始点としたDFS
    seen = [0] * n
    todo = [s]
    while todo != []:
        v = todo.pop(len(todo) - 1)  # FILO
        seen[v] = 1
        for i in g[v]:
            if seen[i] == 0:
                todo.append(i)
    return seen[t]


ans = 0
for i in range(m):
    H = copy.deepcopy(G)
    H[a[i] - 1].remove(b[i] - 1)
    H[b[i] - 1].remove(a[i] - 1)
    ans += 1 - dfs(H, a[i] - 1, b[i] - 1)
print(ans)

import sys
import copy

sys.setrecursionlimit(10000)


def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]


def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx != ry:
        par[rx] = ry


def same(x, y):
    return root(x) == root(y)


n, m = list(map(int, input().split()))
par = [i for i in range(n)]
a = [0] * m
b = [0] * m
for i in range(m):
    a[i], b[i] = list(map(int, input().split()))
ans = 0
for i in range(m):
    c = copy.deepcopy(a)
    d = copy.deepcopy(b)
    c = c[:i] + c[i + 1 :]
    d = d[:i] + d[i + 1 :]
    par = [i for i in range(n)]
    for j in range(m - 1):
        unite(c[j] - 1, d[j] - 1)
    if not same(a[i] - 1, b[i] - 1):
        ans += 1
print(ans)

+import sys +sys.setrecursionlimit(10000) + + +def root(x): +    if par[x] == x: +        return x +    else: +        par[x] = root(par[x]) +        return par[x] + + +def unite(x, y): +    rx = root(x) +    ry = root(y) +    if rx != ry: +        par[rx] = ry + + +def same(x, y): +    return root(x) == root(y) + + -G = [[] for i in range(n)]  # G(i): 頂点iと隣接する頂点のlist +par = [i for i in range(n)] -    G[a[i] - 1].append(b[i] - 1)  # 入力は 1-indexed とする -    G[b[i] - 1].append(a[i] - 1)  # 無向グラフの場合 -seen = [0] * n  # 頂点iが訪問済みの場合 seen[i] = 1 - - -def dfs(g, s, t):  # 頂点sを始点としたDFS -    seen = [0] * n -    todo = [s] -    while todo != []: -        v = todo.pop(len(todo) - 1)  # FILO -        seen[v] = 1 -        for i in g[v]: -            if seen[i] == 0: -                todo.append(i) -    return seen[t] - - -    H = copy.deepcopy(G) -    H[a[i] - 1].remove(b[i] - 1) -    H[b[i] - 1].remove(a[i] - 1) -    ans += 1 - dfs(H, a[i] - 1, b[i] - 1) +    c = copy.deepcopy(a) +    d = copy.deepcopy(b) +    c = c[:i] + c[i + 1 :] +    d = d[:i] + d[i + 1 :] +    par = [i for i in range(n)] +    for j in range(m - 1): +        unite(c[j] - 1, d[j] - 1) +    if not same(a[i] - 1, b[i] - 1): +        ans += 1