N, M = [int(a) for a in input().split()]

adj = [[False] * N for _ in range(N)]

edgelist = []

for i in range(M):

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

    a-=1

    b-=1

    adj[a][b] = True

    adj[b][a] = True

    edgelist.append((a,b))



bridges = 0

for a,b in edgelist:

    adj[a][b] = False

    adj[b][a] = False



    marked = [False] * N

    stk = [a]

    while stk:

        x = stk.pop()

        marked[x] = True

        for i in range(N):

            if adj[x][i] and not marked[i]:

                stk.append(i)

    if not marked[b]:

        bridges += 1



    adj[a][b] = True

    adj[b][a] = True



print(bridges)
def f(a, b, nodes, visited):

    if (a in visited):

        return False

    if (a == b):

        return True

    visited.append(a)

    for e in nodes[a]:

        if (f(e, b, nodes, visited)):

            return True

    return False





def main():

    n, m = [int(x) for x in input().split(' ')]

    nodes = {}

    edges = []

    for _ in range(m):

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

        if (a in nodes):

            nodes[a].append(b)

        else:

            nodes[a] = [b]

        if (b in nodes):

            nodes[b].append(a)

        else:

            nodes[b] = [a]

        edges.append((a, b))

    ans = 0

    for a, b in edges:

        nodes[a] = [x for x in nodes[a] if x != b]

        nodes[b] = [x for x in nodes[b] if x != a]

        if (not f(a, b, nodes, [])):

            ans += 1

        nodes[a].append(b)

        nodes[b].append(a)

    print(ans)





main()

N, M = [int(a) for a in input().split()]
adj = [[False] * N for _ in range(N)]
edgelist = []
for i in range(M):
    a, b = [int(a) for a in input().split()]
    a -= 1
    b -= 1
    adj[a][b] = True
    adj[b][a] = True
    edgelist.append((a, b))
bridges = 0
for a, b in edgelist:
    adj[a][b] = False
    adj[b][a] = False
    marked = [False] * N
    stk = [a]
    while stk:
        x = stk.pop()
        marked[x] = True
        for i in range(N):
            if adj[x][i] and not marked[i]:
                stk.append(i)
    if not marked[b]:
        bridges += 1
    adj[a][b] = True
    adj[b][a] = True
print(bridges)

def f(a, b, nodes, visited):
    if a in visited:
        return False
    if a == b:
        return True
    visited.append(a)
    for e in nodes[a]:
        if f(e, b, nodes, visited):
            return True
    return False


def main():
    n, m = [int(x) for x in input().split(" ")]
    nodes = {}
    edges = []
    for _ in range(m):
        a, b = [int(x) for x in input().split(" ")]
        if a in nodes:
            nodes[a].append(b)
        else:
            nodes[a] = [b]
        if b in nodes:
            nodes[b].append(a)
        else:
            nodes[b] = [a]
        edges.append((a, b))
    ans = 0
    for a, b in edges:
        nodes[a] = [x for x in nodes[a] if x != b]
        nodes[b] = [x for x in nodes[b] if x != a]
        if not f(a, b, nodes, []):
            ans += 1
        nodes[a].append(b)
        nodes[b].append(a)
    print(ans)


main()

-N, M = [int(a) for a in input().split()] -adj = [[False] * N for _ in range(N)] -edgelist = [] -for i in range(M): -    a, b = [int(a) for a in input().split()] -    a -= 1 -    b -= 1 -    adj[a][b] = True -    adj[b][a] = True -    edgelist.append((a, b)) -bridges = 0 -for a, b in edgelist: -    adj[a][b] = False -    adj[b][a] = False -    marked = [False] * N -    stk = [a] -    while stk: -        x = stk.pop() -        marked[x] = True -        for i in range(N): -            if adj[x][i] and not marked[i]: -                stk.append(i) -    if not marked[b]: -        bridges += 1 -    adj[a][b] = True -    adj[b][a] = True -print(bridges) +def f(a, b, nodes, visited): +    if a in visited: +        return False +    if a == b: +        return True +    visited.append(a) +    for e in nodes[a]: +        if f(e, b, nodes, visited): +            return True +    return False + + +def main(): +    n, m = [int(x) for x in input().split(" ")] +    nodes = {} +    edges = [] +    for _ in range(m): +        a, b = [int(x) for x in input().split(" ")] +        if a in nodes: +            nodes[a].append(b) +        else: +            nodes[a] = [b] +        if b in nodes: +            nodes[b].append(a) +        else: +            nodes[b] = [a] +        edges.append((a, b)) +    ans = 0 +    for a, b in edges: +        nodes[a] = [x for x in nodes[a] if x != b] +        nodes[b] = [x for x in nodes[b] if x != a] +        if not f(a, b, nodes, []): +            ans += 1 +        nodes[a].append(b) +        nodes[b].append(a) +    print(ans) + + +main()