def Con(V,E):

  C1,C2=set(),set()

  C1.add(1)

  while len(C1)>len(C2):

    for v in V:

      if v in C1 and v not in C2:

        for e in E:

          if e[0]==v:

            C1.add(e[1])

          elif e[1]==v:

            C1.add(e[0])

        C2.add(v)

  if len(C1)==len(V):

    return True

  else:

    return False

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

V=[int(i) for i in range(1,n+1)]

E=[]

for i in range(m):

  s,g=list(map(int,input().split()))

  E.append([s,g])

ans=0

for i in range(m):

  if Con(V,E[:i]+E[i+1:])==False:

    ans+=1

print(ans)
import sys

input=lambda: sys.stdin.readline().rstrip()

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

def find(x):

  if par[x]<0:

    return x

  else:

    par[x]=find(par[x])

    return par[x]



def unite(x,y):

  x=find(x)

  y=find(y)

  if x==y:

    return False

  else:

    if par[x]>par[y]:

      x,y=y,x

    par[x]+=par[y]

    par[y]=x

    return True



def same(x,y):

  return find(x)==find(y)



def size(x):

  return -par[find(x)]



AB=[]

for i in range(m):

  AB.append(tuple(int(i) for i in input().split()))

ans=0

for i in range(m):

  par=[-1]*n

  for j in range(m):

    if j==i:

      continue

    else:

      a,b=AB[j]

      unite(a-1,b-1)

  for i in range(n):

    find(i)

  if -min(par)<n:

    ans+=1

print(ans)
def Con(V, E):
    C1, C2 = set(), set()
    C1.add(1)
    while len(C1) > len(C2):
        for v in V:
            if v in C1 and v not in C2:
                for e in E:
                    if e[0] == v:
                        C1.add(e[1])
                    elif e[1] == v:
                        C1.add(e[0])
                C2.add(v)
    if len(C1) == len(V):
        return True
    else:
        return False


n, m = list(map(int, input().split()))
V = [int(i) for i in range(1, n + 1)]
E = []
for i in range(m):
    s, g = list(map(int, input().split()))
    E.append([s, g])
ans = 0
for i in range(m):
    if Con(V, E[:i] + E[i + 1 :]) == False:
        ans += 1
print(ans)

import sys

input = lambda: sys.stdin.readline().rstrip()
n, m = list(map(int, input().split()))


def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
        if par[x] > par[y]:
            x, y = y, x
        par[x] += par[y]
        par[y] = x
        return True


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


def size(x):
    return -par[find(x)]


AB = []
for i in range(m):
    AB.append(tuple(int(i) for i in input().split()))
ans = 0
for i in range(m):
    par = [-1] * n
    for j in range(m):
        if j == i:
            continue
        else:
            a, b = AB[j]
            unite(a - 1, b - 1)
    for i in range(n):
        find(i)
    if -min(par) < n:
        ans += 1
print(ans)

-def Con(V, E): -    C1, C2 = set(), set() -    C1.add(1) -    while len(C1) > len(C2): -        for v in V: -            if v in C1 and v not in C2: -                for e in E: -                    if e[0] == v: -                        C1.add(e[1]) -                    elif e[1] == v: -                        C1.add(e[0]) -                C2.add(v) -    if len(C1) == len(V): -        return True -    else: -        return False +import sys + +input = lambda: sys.stdin.readline().rstrip() +n, m = list(map(int, input().split())) -n, m = list(map(int, input().split())) -V = [int(i) for i in range(1, n + 1)] -E = [] +def find(x): +    if par[x] < 0: +        return x +    else: +        par[x] = find(par[x]) +        return par[x] + + +def unite(x, y): +    x = find(x) +    y = find(y) +    if x == y: +        return False +    else: +        if par[x] > par[y]: +            x, y = y, x +        par[x] += par[y] +        par[y] = x +        return True + + +def same(x, y): +    return find(x) == find(y) + + +def size(x): +    return -par[find(x)] + + +AB = [] -    s, g = list(map(int, input().split())) -    E.append([s, g]) +    AB.append(tuple(int(i) for i in input().split())) -    if Con(V, E[:i] + E[i + 1 :]) == False: +    par = [-1] * n +    for j in range(m): +        if j == i: +            continue +        else: +            a, b = AB[j] +            unite(a - 1, b - 1) +    for i in range(n): +        find(i) +    if -min(par) < n: