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

List=[[int(i) for i in input().split()] for i in range(M)]

S=0

for i in range(M):

  new_List=list(List)

  del new_List[i]

  islands=[1]

  for i in islands:

    for j in new_List:

      if i in j:

        j=[item for item in j if item not in islands]

        islands.extend(j)

  if len(islands)<N:

    S+=1

print(S)  

  
class Unionfind:

  def __init__(self,n):

     self.Tree=[i for i in range(n)]



  def find(self,x):

    if x==self.Tree[x]:

      return x

    else:

      root=self.find(self.Tree[x])

      self.Tree[x]=root

      return root



  def unite(self,x,y):

    s1=self.find(x)

    s2=self.find(y)

    if s1==s2:

      pass

    else:

      self.Tree[s1]=s2

      

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

Uf=Unionfind(N)

Flag=0

B=0

A=[]

Edge=[[int(i) for i in input().split()] for i in range(M)]

for m in range(M):

  Edge_copy=list(Edge)

  del Edge_copy[m]

  for e in Edge_copy:

    Uf.unite(e[0]-1,e[1]-1)

  for a in range(N):

    A.append(Uf.find(a))

  for n in range(N-1):

    if Uf.find(n)!=Uf.find(n+1):

      Flag=1

      break

  if Flag==1:

    B+=1

  Flag=0

  Uf=Unionfind(N)

  A=[]

print(B)   
N, M = list(map(int, input().split()))
List = [[int(i) for i in input().split()] for i in range(M)]
S = 0
for i in range(M):
    new_List = list(List)
    del new_List[i]
    islands = [1]
    for i in islands:
        for j in new_List:
            if i in j:
                j = [item for item in j if item not in islands]
                islands.extend(j)
    if len(islands) < N:
        S += 1
print(S)

class Unionfind:
    def __init__(self, n):
        self.Tree = [i for i in range(n)]

    def find(self, x):
        if x == self.Tree[x]:
            return x
        else:
            root = self.find(self.Tree[x])
            self.Tree[x] = root
            return root

    def unite(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 == s2:
            pass
        else:
            self.Tree[s1] = s2


N, M = list(map(int, input().split()))
Uf = Unionfind(N)
Flag = 0
B = 0
A = []
Edge = [[int(i) for i in input().split()] for i in range(M)]
for m in range(M):
    Edge_copy = list(Edge)
    del Edge_copy[m]
    for e in Edge_copy:
        Uf.unite(e[0] - 1, e[1] - 1)
    for a in range(N):
        A.append(Uf.find(a))
    for n in range(N - 1):
        if Uf.find(n) != Uf.find(n + 1):
            Flag = 1
            break
    if Flag == 1:
        B += 1
    Flag = 0
    Uf = Unionfind(N)
    A = []
print(B)

+class Unionfind: +    def __init__(self, n): +        self.Tree = [i for i in range(n)] + +    def find(self, x): +        if x == self.Tree[x]: +            return x +        else: +            root = self.find(self.Tree[x]) +            self.Tree[x] = root +            return root + +    def unite(self, x, y): +        s1 = self.find(x) +        s2 = self.find(y) +        if s1 == s2: +            pass +        else: +            self.Tree[s1] = s2 + + -List = [[int(i) for i in input().split()] for i in range(M)] -S = 0 -for i in range(M): -    new_List = list(List) -    del new_List[i] -    islands = [1] -    for i in islands: -        for j in new_List: -            if i in j: -                j = [item for item in j if item not in islands] -                islands.extend(j) -    if len(islands) < N: -        S += 1 -print(S) +Uf = Unionfind(N) +Flag = 0 +B = 0 +A = [] +Edge = [[int(i) for i in input().split()] for i in range(M)] +for m in range(M): +    Edge_copy = list(Edge) +    del Edge_copy[m] +    for e in Edge_copy: +        Uf.unite(e[0] - 1, e[1] - 1) +    for a in range(N): +        A.append(Uf.find(a)) +    for n in range(N - 1): +        if Uf.find(n) != Uf.find(n + 1): +            Flag = 1 +            break +    if Flag == 1: +        B += 1 +    Flag = 0 +    Uf = Unionfind(N) +    A = [] +print(B)