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

e=[[] for _ in range(n)]

b=[]



for i in range(m):

  x,y=list(map(int,input().split()))

  e[x-1].append(y-1)

  e[y-1].append(x-1)

  b.append([x-1,y-1])



def ne(now,s,visit):

  visit.append(now)

  for i in e[now]:

    if i not in visit:

      ne(i, s, visit[:])

    elif len(visit)>2 and s==i:

      v1=visit[1]

      v2=visit[-1]

      if [s,v1] in b: b.remove([s,v1])

      elif [v1,s] in b: b.remove([v1,s])

      if [s,v2] in b:b.remove([s,v2])

      elif [v2,s] in b:b.remove([v2,s])

      break



for i in range(n):

  ne(i,i,[])

print((len(b)))
from itertools import combinations

class UnionFind():

    def __init__(self, n):

        self.n = n

        self.root = [-1]*(n+1)

        self.rnk = [0]*(n+1)

    def Find_Root(self, x):

        if(self.root[x] < 0):

            return x

        else:

            self.root[x] = self.Find_Root(self.root[x])

            return self.root[x]

    def Unite(self, x, y):

        x = self.Find_Root(x)

        y = self.Find_Root(y)

        if(x == y):

            return 

        elif(self.rnk[x] > self.rnk[y]):

            self.root[x] += self.root[y]

            self.root[y] = x

        else:

            self.root[y] += self.root[x]

            self.root[x] = y

            if(self.rnk[x] == self.rnk[y]):

                self.rnk[y] += 1

    def isSameGroup(self, x, y):

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

    def Count(self, x):

        return -self.root[self.Find_Root(x)]



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

uf=UnionFind(n)

e=[]

comb=list(combinations(list(range(n)),2))

for _ 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)

  for j in range(m):

    if i==j:continue

    uf.Unite(*e[j])

  if not all([uf.isSameGroup(x,y) for x,y in comb]):ans+=1

print(ans)
n, m = list(map(int, input().split()))
e = [[] for _ in range(n)]
b = []
for i in range(m):
    x, y = list(map(int, input().split()))
    e[x - 1].append(y - 1)
    e[y - 1].append(x - 1)
    b.append([x - 1, y - 1])


def ne(now, s, visit):
    visit.append(now)
    for i in e[now]:
        if i not in visit:
            ne(i, s, visit[:])
        elif len(visit) > 2 and s == i:
            v1 = visit[1]
            v2 = visit[-1]
            if [s, v1] in b:
                b.remove([s, v1])
            elif [v1, s] in b:
                b.remove([v1, s])
            if [s, v2] in b:
                b.remove([s, v2])
            elif [v2, s] in b:
                b.remove([v2, s])
            break


for i in range(n):
    ne(i, i, [])
print((len(b)))

from itertools import combinations


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.root = [-1] * (n + 1)
        self.rnk = [0] * (n + 1)

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

    def Unite(self, x, y):
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        if x == y:
            return
        elif self.rnk[x] > self.rnk[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rnk[x] == self.rnk[y]:
                self.rnk[y] += 1

    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    def Count(self, x):
        return -self.root[self.Find_Root(x)]


n, m = list(map(int, input().split()))
uf = UnionFind(n)
e = []
comb = list(combinations(list(range(n)), 2))
for _ 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)
    for j in range(m):
        if i == j:
            continue
        uf.Unite(*e[j])
    if not all([uf.isSameGroup(x, y) for x, y in comb]):
        ans += 1
print(ans)

-n, m = list(map(int, input().split())) -e = [[] for _ in range(n)] -b = [] -for i in range(m): -    x, y = list(map(int, input().split())) -    e[x - 1].append(y - 1) -    e[y - 1].append(x - 1) -    b.append([x - 1, y - 1]) +from itertools import combinations -def ne(now, s, visit): -    visit.append(now) -    for i in e[now]: -        if i not in visit: -            ne(i, s, visit[:]) -        elif len(visit) > 2 and s == i: -            v1 = visit[1] -            v2 = visit[-1] -            if [s, v1] in b: -                b.remove([s, v1]) -            elif [v1, s] in b: -                b.remove([v1, s]) -            if [s, v2] in b: -                b.remove([s, v2]) -            elif [v2, s] in b: -                b.remove([v2, s]) -            break +class UnionFind: +    def __init__(self, n): +        self.n = n +        self.root = [-1] * (n + 1) +        self.rnk = [0] * (n + 1) + +    def Find_Root(self, x): +        if self.root[x] < 0: +            return x +        else: +            self.root[x] = self.Find_Root(self.root[x]) +            return self.root[x] + +    def Unite(self, x, y): +        x = self.Find_Root(x) +        y = self.Find_Root(y) +        if x == y: +            return +        elif self.rnk[x] > self.rnk[y]: +            self.root[x] += self.root[y] +            self.root[y] = x +        else: +            self.root[y] += self.root[x] +            self.root[x] = y +            if self.rnk[x] == self.rnk[y]: +                self.rnk[y] += 1 + +    def isSameGroup(self, x, y): +        return self.Find_Root(x) == self.Find_Root(y) + +    def Count(self, x): +        return -self.root[self.Find_Root(x)] -for i in range(n): -    ne(i, i, []) -print((len(b))) +n, m = list(map(int, input().split())) +uf = UnionFind(n) +e = [] +comb = list(combinations(list(range(n)), 2)) +for _ 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) +    for j in range(m): +        if i == j: +            continue +        uf.Unite(*e[j]) +    if not all([uf.isSameGroup(x, y) for x, y in comb]): +        ans += 1 +print(ans)