# ABC075 C - Bridge

def dfs(v):

    visited[v]=True

    for nv in range(n):

        if G[v][nv]==False:

            continue

        if visited[nv]:

            continue

        dfs(nv)



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

G = [[False]*n for _ in range(n)]

ans = 0

visited = [False for _ in range(n)]

A,B = [],[]

for i in range(m):

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

    A.append(b-1)

    B.append(a-1)

    G[a-1][b-1]=G[b-1][a-1]=True



for i in range(m):

    G[A[i]][B[i]]=G[B[i]][A[i]]=False

    visited = [False for _ in range(n)]

    dfs(0)

    if all(visited):

        ans += 1

    G[A[i]][B[i]]=G[B[i]][A[i]]=True



print((m-ans))

class UnionFind:

    def __init__(self, n):

        self.p = [-1]*n

        # union by rank

        self.r = [1]*n

 

    def find(self, x):

        if self.p[x] < 0:

            return x

        else:

            self.p[x] = self.find(self.p[x])

            return self.p[x]

 

    def union(self, x, y):

        rx, ry = self.find(x), self.find(y)

 

        if rx != ry:

            if self.r[rx] > self.r[ry]:

                rx, ry = ry, rx

            if self.r[rx] == self.r[ry]:

                self.r[ry] += 1

            self.p[ry] += self.p[rx]

            self.p[rx] = ry

 

    def same(self, x, y):

        return self.find(x) == self.find(y)

 

    def count_member(self, x):

        return -self.p[self.find(x)]



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

e=[]

for i in range(m):

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

  e.append((a-1,b-1))

ans=0

for i in range(m):

  uf=UnionFind(n)

  ok=False

  for j in range(m):

    if i!=j:

      a,b=e[j]

      uf.union(a,b)

  for k in range(n):

    t=uf.count_member(k)

    if t!=n:

      ok=True

      break

  if ok:ans+=1

print(ans)



# ABC075 C - Bridge
def dfs(v):
    visited[v] = True
    for nv in range(n):
        if G[v][nv] == False:
            continue
        if visited[nv]:
            continue
        dfs(nv)


n, m = list(map(int, input().split()))
G = [[False] * n for _ in range(n)]
ans = 0
visited = [False for _ in range(n)]
A, B = [], []
for i in range(m):
    a, b = list(map(int, input().split()))
    A.append(b - 1)
    B.append(a - 1)
    G[a - 1][b - 1] = G[b - 1][a - 1] = True
for i in range(m):
    G[A[i]][B[i]] = G[B[i]][A[i]] = False
    visited = [False for _ in range(n)]
    dfs(0)
    if all(visited):
        ans += 1
    G[A[i]][B[i]] = G[B[i]][A[i]] = True
print((m - ans))

class UnionFind:
    def __init__(self, n):
        self.p = [-1] * n
        # union by rank
        self.r = [1] * n

    def find(self, x):
        if self.p[x] < 0:
            return x
        else:
            self.p[x] = self.find(self.p[x])
            return self.p[x]

    def union(self, x, y):
        rx, ry = self.find(x), self.find(y)
        if rx != ry:
            if self.r[rx] > self.r[ry]:
                rx, ry = ry, rx
            if self.r[rx] == self.r[ry]:
                self.r[ry] += 1
            self.p[ry] += self.p[rx]
            self.p[rx] = ry

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def count_member(self, x):
        return -self.p[self.find(x)]


n, m = list(map(int, input().split()))
e = []
for i in range(m):
    a, b = list(map(int, input().split()))
    e.append((a - 1, b - 1))
ans = 0
for i in range(m):
    uf = UnionFind(n)
    ok = False
    for j in range(m):
        if i != j:
            a, b = e[j]
            uf.union(a, b)
    for k in range(n):
        t = uf.count_member(k)
        if t != n:
            ok = True
            break
    if ok:
        ans += 1
print(ans)

-# ABC075 C - Bridge -def dfs(v): -    visited[v] = True -    for nv in range(n): -        if G[v][nv] == False: -            continue -        if visited[nv]: -            continue -        dfs(nv) +class UnionFind: +    def __init__(self, n): +        self.p = [-1] * n +        # union by rank +        self.r = [1] * n + +    def find(self, x): +        if self.p[x] < 0: +            return x +        else: +            self.p[x] = self.find(self.p[x]) +            return self.p[x] + +    def union(self, x, y): +        rx, ry = self.find(x), self.find(y) +        if rx != ry: +            if self.r[rx] > self.r[ry]: +                rx, ry = ry, rx +            if self.r[rx] == self.r[ry]: +                self.r[ry] += 1 +            self.p[ry] += self.p[rx] +            self.p[rx] = ry + +    def same(self, x, y): +        return self.find(x) == self.find(y) + +    def count_member(self, x): +        return -self.p[self.find(x)] -G = [[False] * n for _ in range(n)] -ans = 0 -visited = [False for _ in range(n)] -A, B = [], [] +e = [] -    A.append(b - 1) -    B.append(a - 1) -    G[a - 1][b - 1] = G[b - 1][a - 1] = True +    e.append((a - 1, b - 1)) +ans = 0 -    G[A[i]][B[i]] = G[B[i]][A[i]] = False -    visited = [False for _ in range(n)] -    dfs(0) -    if all(visited): +    uf = UnionFind(n) +    ok = False +    for j in range(m): +        if i != j: +            a, b = e[j] +            uf.union(a, b) +    for k in range(n): +        t = uf.count_member(k) +        if t != n: +            ok = True +            break +    if ok: -    G[A[i]][B[i]] = G[B[i]][A[i]] = True -print((m - ans)) +print(ans)