from copy import deepcopy

from scipy.sparse.csgraph import floyd_warshall



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

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



cnt=0

for i in range(m):

  ll=deepcopy(l)

  del ll[i]



  d=[[float('inf')]*n for i in range(n)]

  for i in range(n):

    d[i][i]=0



  for a,b in ll:

    a-=1

    b-=1

    d[a][b]=1

    d[b][a]=1



  s=floyd_warshall(d)

  for i in s:

    if float('inf') in i:

      cnt+=1

      break



print(cnt)
from collections import deque

from copy import deepcopy



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

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



def BFS(m):

  t_l=deepcopy(l)

  del t_l[m]



  tree=[[] for j in range(n)]

  for a,b in t_l:

    a-=1

    b-=1

    tree[a].append(b)

    tree[b].append(a)



  dist=[-1 for i in range(n)]

  dist[0]=0



  que=deque()

  que.append(0)



  while que:

    x=que.popleft()

    for i in tree[x]:

      if dist[i]==-1:

        que.append(i)

        dist[i]=dist[x]+1



  return dist



ans=0

for i in range(m):

  d=BFS(i)

  if -1 in d:

    ans+=1



print(ans)
from copy import deepcopy
from scipy.sparse.csgraph import floyd_warshall

n, m = list(map(int, input().split()))
l = [list(map(int, input().split())) for i in range(m)]
cnt = 0
for i in range(m):
    ll = deepcopy(l)
    del ll[i]
    d = [[float("inf")] * n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    for a, b in ll:
        a -= 1
        b -= 1
        d[a][b] = 1
        d[b][a] = 1
    s = floyd_warshall(d)
    for i in s:
        if float("inf") in i:
            cnt += 1
            break
print(cnt)

from collections import deque
from copy import deepcopy

n, m = list(map(int, input().split()))
l = [list(map(int, input().split())) for i in range(m)]


def BFS(m):
    t_l = deepcopy(l)
    del t_l[m]
    tree = [[] for j in range(n)]
    for a, b in t_l:
        a -= 1
        b -= 1
        tree[a].append(b)
        tree[b].append(a)
    dist = [-1 for i in range(n)]
    dist[0] = 0
    que = deque()
    que.append(0)
    while que:
        x = que.popleft()
        for i in tree[x]:
            if dist[i] == -1:
                que.append(i)
                dist[i] = dist[x] + 1
    return dist


ans = 0
for i in range(m):
    d = BFS(i)
    if -1 in d:
        ans += 1
print(ans)

+from collections import deque -from scipy.sparse.csgraph import floyd_warshall -cnt = 0 -for i in range(m): -    ll = deepcopy(l) -    del ll[i] -    d = [[float("inf")] * n for i in range(n)] -    for i in range(n): -        d[i][i] = 0 -    for a, b in ll: + + +def BFS(m): +    t_l = deepcopy(l) +    del t_l[m] +    tree = [[] for j in range(n)] +    for a, b in t_l: -        d[a][b] = 1 -        d[b][a] = 1 -    s = floyd_warshall(d) -    for i in s: -        if float("inf") in i: -            cnt += 1 -            break -print(cnt) +        tree[a].append(b) +        tree[b].append(a) +    dist = [-1 for i in range(n)] +    dist[0] = 0 +    que = deque() +    que.append(0) +    while que: +        x = que.popleft() +        for i in tree[x]: +            if dist[i] == -1: +                que.append(i) +                dist[i] = dist[x] + 1 +    return dist + + +ans = 0 +for i in range(m): +    d = BFS(i) +    if -1 in d: +        ans += 1 +print(ans)