def dfs(a, b, f):

    if vis[f] == 1: return

    vis[f] = 1

    for t in V[f]:

        if f!=a or t!=b: dfs(a, b, t)



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

E, V = [], [[] for _ in range(n)]

for _ in range(m):

    a, b = [int(x)-1 for x in input().split()]

    E.append([a, b])

    V[a].append(b); V[b].append(a)

ans = 0

for a, b in E:

    vis = [0]*n

    dfs(a, b, a)

    if vis[b] == 0: ans += 1

print(ans)

def dfs(f):

    if vis[f] == 1: return

    vis[f] = 1

    for t in V[f]:

        if f!=a or t!=b: dfs(t)



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

E = [[*[int(x)-1 for x in input().split()]] for _ in range(m)]

V = [[] for _ in range(n)]

for a, b in E: V[a].append(b); V[b].append(a)

ans = 0

for a, b in E:

    vis = [0]*n

    dfs(a)

    if vis[b] == 0: ans += 1

print(ans)

def dfs(a, b, f):
    if vis[f] == 1:
        return
    vis[f] = 1
    for t in V[f]:
        if f != a or t != b:
            dfs(a, b, t)


n, m = list(map(int, input().split()))
E, V = [], [[] for _ in range(n)]
for _ in range(m):
    a, b = [int(x) - 1 for x in input().split()]
    E.append([a, b])
    V[a].append(b)
    V[b].append(a)
ans = 0
for a, b in E:
    vis = [0] * n
    dfs(a, b, a)
    if vis[b] == 0:
        ans += 1
print(ans)

def dfs(f):
    if vis[f] == 1:
        return
    vis[f] = 1
    for t in V[f]:
        if f != a or t != b:
            dfs(t)


n, m = list(map(int, input().split()))
E = [[*[int(x) - 1 for x in input().split()]] for _ in range(m)]
V = [[] for _ in range(n)]
for a, b in E:
    V[a].append(b)
    V[b].append(a)
ans = 0
for a, b in E:
    vis = [0] * n
    dfs(a)
    if vis[b] == 0:
        ans += 1
print(ans)

-def dfs(a, b, f): +def dfs(f): -            dfs(a, b, t) +            dfs(t) -E, V = [], [[] for _ in range(n)] -for _ in range(m): -    a, b = [int(x) - 1 for x in input().split()] -    E.append([a, b]) +E = [[*[int(x) - 1 for x in input().split()]] for _ in range(m)] +V = [[] for _ in range(n)] +for a, b in E: -    dfs(a, b, a) +    dfs(a)