import numpy as np

import sys ; sys.setrecursionlimit(2000)

import copy



def dfs(v1):

    visited[v1] = 1

    for v2 in range(n):

        if graph[v1][v2] == 0: continue

        if visited[v2] == 1: continue

        dfs(v2)

# nは頂点の数

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

ab = np.array([list(map(int,input().split())) for i in range(m)])

a,b = ab.T[0]-1,ab.T[1]-1



#隣接行列

G = np.array([[0] * n for _ in range(n)])

for aa,bb in zip(a,b): G[aa][bb],G[bb][aa] = 1,1



ans = 0

for aa,bb in zip(a,b):

    graph = copy.deepcopy(G)

    graph[aa][bb],graph[bb][aa] = 0,0

    visited = [0]*(n)

    dfs(0)

    if not all(visited): ans += 1



print(ans)





import numpy as np

import copy as cp



def isTree(now=0):

    know[now] = 1

    for next in range(n):

        if know[next]==1 or graph[now][next]==0: continue

        else: isTree(next)

    if all(know): return 1

    else: return 0



# nは頂点の数

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

ab = np.array([list(map(int,input().split())) for i in range(m)])

a,b = ab.T[0]-1,ab.T[1]-1



#隣接行列

G = [[0] * n for _ in range(n)]

for aa,bb in zip(a,b): G[aa][bb],G[bb][aa] = 1,1



ans = 0

for x,y in zip(a,b):

    graph = cp.deepcopy(G)

    graph[x][y],graph[y][x] = 0,0

    know = [0]*(n)

    if not isTree(): ans += 1



print(ans)



import numpy as np
import sys

sys.setrecursionlimit(2000)
import copy


def dfs(v1):
    visited[v1] = 1
    for v2 in range(n):
        if graph[v1][v2] == 0:
            continue
        if visited[v2] == 1:
            continue
        dfs(v2)


# nは頂点の数
n, m = list(map(int, input().split()))
ab = np.array([list(map(int, input().split())) for i in range(m)])
a, b = ab.T[0] - 1, ab.T[1] - 1
# 隣接行列
G = np.array([[0] * n for _ in range(n)])
for aa, bb in zip(a, b):
    G[aa][bb], G[bb][aa] = 1, 1
ans = 0
for aa, bb in zip(a, b):
    graph = copy.deepcopy(G)
    graph[aa][bb], graph[bb][aa] = 0, 0
    visited = [0] * (n)
    dfs(0)
    if not all(visited):
        ans += 1
print(ans)

import numpy as np
import copy as cp


def isTree(now=0):
    know[now] = 1
    for next in range(n):
        if know[next] == 1 or graph[now][next] == 0:
            continue
        else:
            isTree(next)
    if all(know):
        return 1
    else:
        return 0


# nは頂点の数
n, m = list(map(int, input().split()))
ab = np.array([list(map(int, input().split())) for i in range(m)])
a, b = ab.T[0] - 1, ab.T[1] - 1
# 隣接行列
G = [[0] * n for _ in range(n)]
for aa, bb in zip(a, b):
    G[aa][bb], G[bb][aa] = 1, 1
ans = 0
for x, y in zip(a, b):
    graph = cp.deepcopy(G)
    graph[x][y], graph[y][x] = 0, 0
    know = [0] * (n)
    if not isTree():
        ans += 1
print(ans)

-import sys - -sys.setrecursionlimit(2000) -import copy +import copy as cp -def dfs(v1): -    visited[v1] = 1 -    for v2 in range(n): -        if graph[v1][v2] == 0: +def isTree(now=0): +    know[now] = 1 +    for next in range(n): +        if know[next] == 1 or graph[now][next] == 0: -        if visited[v2] == 1: -            continue -        dfs(v2) +        else: +            isTree(next) +    if all(know): +        return 1 +    else: +        return 0 -G = np.array([[0] * n for _ in range(n)]) +G = [[0] * n for _ in range(n)] -for aa, bb in zip(a, b): -    graph = copy.deepcopy(G) -    graph[aa][bb], graph[bb][aa] = 0, 0 -    visited = [0] * (n) -    dfs(0) -    if not all(visited): +for x, y in zip(a, b): +    graph = cp.deepcopy(G) +    graph[x][y], graph[y][x] = 0, 0 +    know = [0] * (n) +    if not isTree():