import collections

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

a = [0]*M

b = [0]*M

table = collections.defaultdict(list)

for i in range(M):

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

    table[a[i]].append(b[i])

    table[b[i]].append(a[i])

bridge = []

for x in table:

    if len(table[x]) < 2:

        bridge.append(x)

prev = 0

now = len(bridge)

while(prev != now):

    for x in table:

        if x not in bridge:

            lenx = len(table[x])

            for y in table[x]:

                if y in bridge:

                    lenx -= 1

            if lenx < 2:

                bridge.append(x)

    prev = now

    now = len(bridge)

ans = 0

for i in range(M):

    if a[i] in bridge or b[i] in bridge:

        ans += 1



print(ans)

import collections

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

ab = [tuple(map(int, input().split())) for i in range(M)]



G = [set() for i in range(N)]



for a, b in ab:

    a -= 1

    b -= 1

    G[a].add(b)

    G[b].add(a)



ans = 0

for a, b in ab:

    a -= 1

    b -= 1

    q = collections.deque([0])

    r = [1]*N

    r[0] = 1

    while(q):

        x = q.popleft()

        for y in G[x]:

            if (x == a and y == b) or (x == b and y == a):

                continue

            else:

                if r[y]:

                    r[y] = 0

                    q.append(y)

    if sum(r) > 0:

        ans += 1

print(ans)

import collections

N, M = list(map(int, input().split()))
a = [0] * M
b = [0] * M
table = collections.defaultdict(list)
for i in range(M):
    a[i], b[i] = list(map(int, input().split()))
    table[a[i]].append(b[i])
    table[b[i]].append(a[i])
bridge = []
for x in table:
    if len(table[x]) < 2:
        bridge.append(x)
prev = 0
now = len(bridge)
while prev != now:
    for x in table:
        if x not in bridge:
            lenx = len(table[x])
            for y in table[x]:
                if y in bridge:
                    lenx -= 1
            if lenx < 2:
                bridge.append(x)
    prev = now
    now = len(bridge)
ans = 0
for i in range(M):
    if a[i] in bridge or b[i] in bridge:
        ans += 1
print(ans)

import collections

N, M = list(map(int, input().split()))
ab = [tuple(map(int, input().split())) for i in range(M)]
G = [set() for i in range(N)]
for a, b in ab:
    a -= 1
    b -= 1
    G[a].add(b)
    G[b].add(a)
ans = 0
for a, b in ab:
    a -= 1
    b -= 1
    q = collections.deque([0])
    r = [1] * N
    r[0] = 1
    while q:
        x = q.popleft()
        for y in G[x]:
            if (x == a and y == b) or (x == b and y == a):
                continue
            else:
                if r[y]:
                    r[y] = 0
                    q.append(y)
    if sum(r) > 0:
        ans += 1
print(ans)

-a = [0] * M -b = [0] * M -table = collections.defaultdict(list) -for i in range(M): -    a[i], b[i] = list(map(int, input().split())) -    table[a[i]].append(b[i]) -    table[b[i]].append(a[i]) -bridge = [] -for x in table: -    if len(table[x]) < 2: -        bridge.append(x) -prev = 0 -now = len(bridge) -while prev != now: -    for x in table: -        if x not in bridge: -            lenx = len(table[x]) -            for y in table[x]: -                if y in bridge: -                    lenx -= 1 -            if lenx < 2: -                bridge.append(x) -    prev = now -    now = len(bridge) +ab = [tuple(map(int, input().split())) for i in range(M)] +G = [set() for i in range(N)] +for a, b in ab: +    a -= 1 +    b -= 1 +    G[a].add(b) +    G[b].add(a) -for i in range(M): -    if a[i] in bridge or b[i] in bridge: +for a, b in ab: +    a -= 1 +    b -= 1 +    q = collections.deque([0]) +    r = [1] * N +    r[0] = 1 +    while q: +        x = q.popleft() +        for y in G[x]: +            if (x == a and y == b) or (x == b and y == a): +                continue +            else: +                if r[y]: +                    r[y] = 0 +                    q.append(y) +    if sum(r) > 0: