import copy

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

graph = [[] for _ in range(N)]

edges = []

for _ in range(M):

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

    graph[a-1].append(b-1)

    graph[b-1].append(a-1)

    edges.append([a-1,b-1])





def dfs(G,v):

    seen[v] = True

    #print(seen)

    for nv in G[v]:

        #print(nv)

        if seen[nv]:

            continue

        dfs(G,nv)



ans = 0

for edge in edges:

    seen = [False] * N

    copied_graph = copy.deepcopy(graph)

    copied_graph[edge[0]].remove(edge[1])

    copied_graph[edge[1]].remove(edge[0])

    dfs(copied_graph,0)

    if not all(seen):

        ans += 1



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







def find(x):

    if par[x] < 0:

        return x

    else:

        par[x] = find(par[x])

        return par[x]



def unite(x,y):

    x = find(x)

    y = find(y)



    if x == y:

        return False

    else:

        if par[x] > par[y]:

            x,y = y,x

        par[x] += par[y]

        par[y] = x

        return True



def same(x,y):

    return find(x) == find(y)



def size(x):

    return -par[find(x)]



a = [0]*M

b = [0]*M

for i in range(M):

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

    a[i] -= 1

    b[i] -= 1



# 一つの辺以外を繋いでその辺の両端の点が同じ集合に属していたらその辺は橋ではない

ans = 0

for i in range(M):

    par = [-1] * (N + 1)

    for j in range(M):

        if i != j:

            unite(a[j],b[j])

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

        ans += 1

print(ans)

import copy

N, M = list(map(int, input().split()))
graph = [[] for _ in range(N)]
edges = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    edges.append([a - 1, b - 1])


def dfs(G, v):
    seen[v] = True
    # print(seen)
    for nv in G[v]:
        # print(nv)
        if seen[nv]:
            continue
        dfs(G, nv)


ans = 0
for edge in edges:
    seen = [False] * N
    copied_graph = copy.deepcopy(graph)
    copied_graph[edge[0]].remove(edge[1])
    copied_graph[edge[1]].remove(edge[0])
    dfs(copied_graph, 0)
    if not all(seen):
        ans += 1
print(ans)

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


def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
        if par[x] > par[y]:
            x, y = y, x
        par[x] += par[y]
        par[y] = x
        return True


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


def size(x):
    return -par[find(x)]


a = [0] * M
b = [0] * M
for i in range(M):
    a[i], b[i] = list(map(int, input().split()))
    a[i] -= 1
    b[i] -= 1
# 一つの辺以外を繋いでその辺の両端の点が同じ集合に属していたらその辺は橋ではない
ans = 0
for i in range(M):
    par = [-1] * (N + 1)
    for j in range(M):
        if i != j:
            unite(a[j], b[j])
    if not same(a[i], b[i]):
        ans += 1
print(ans)

-import copy - -graph = [[] for _ in range(N)] -edges = [] -for _ in range(M): -    a, b = list(map(int, input().split())) -    graph[a - 1].append(b - 1) -    graph[b - 1].append(a - 1) -    edges.append([a - 1, b - 1]) -def dfs(G, v): -    seen[v] = True -    # print(seen) -    for nv in G[v]: -        # print(nv) -        if seen[nv]: -            continue -        dfs(G, nv) +def find(x): +    if par[x] < 0: +        return x +    else: +        par[x] = find(par[x]) +        return par[x] +def unite(x, y): +    x = find(x) +    y = find(y) +    if x == y: +        return False +    else: +        if par[x] > par[y]: +            x, y = y, x +        par[x] += par[y] +        par[y] = x +        return True + + +def same(x, y): +    return find(x) == find(y) + + +def size(x): +    return -par[find(x)] + + +a = [0] * M +b = [0] * M +for i in range(M): +    a[i], b[i] = list(map(int, input().split())) +    a[i] -= 1 +    b[i] -= 1 +# 一つの辺以外を繋いでその辺の両端の点が同じ集合に属していたらその辺は橋ではない -for edge in edges: -    seen = [False] * N -    copied_graph = copy.deepcopy(graph) -    copied_graph[edge[0]].remove(edge[1]) -    copied_graph[edge[1]].remove(edge[0]) -    dfs(copied_graph, 0) -    if not all(seen): +for i in range(M): +    par = [-1] * (N + 1) +    for j in range(M): +        if i != j: +            unite(a[j], b[j]) +    if not same(a[i], b[i]):