from collections import Counter,defaultdict,deque

from heapq import heapify,heappop,heappush

import sys,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



class UnionFind():

    def __init__(self, n):

        self.n = n

        self.parents = [-1] * n



    #根を返す

    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

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

            return self.parents[x]



    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)



        if x == y:

            return



        if self.parents[x] > self.parents[y]:

            x, y = y, x



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

        self.parents[y] = x



    def size(self, x):

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



    def same(self, x, y):

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



    def members(self, x):

        root = self.find(x)

        return [i for i in range(self.n) if self.find(i) == root]



n,m = inpl()

ab = [0] * m

for i in range(m):

    a,b = inpl()

    ab[i] = (a-1,b-1)



res = 0

for _ in range(m):

    uf = UnionFind(n)

    for i in range(m):

        if _ == i:

            continue

        uf.union(ab[i][0],ab[i][1])

    if uf.size(0) != n:

        res += 1

print(res)

from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n,m = inpl()

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

r = dict()

cnt = 0

for _ in range(m):

    a,b = inpl()

    g[a-1].append(b-1)

    g[b-1].append(a-1)

    r[cnt] = (a-1,b-1)

    cnt += 1

res = 0

def chk(g):

    seen = [False] * n

    seen[0] = True

    q = deque([0])

    while q:

        v = q.popleft()

        for nv in g[v]:

            if seen[nv]:

                continue

            seen[nv] = True

            q.append(nv)

    if sum(seen) == n:

        return True

    return False

for i in range(m):

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

    a,b = r[i]

    for j in range(n):

        for k in g[j]:

            if (j,k) == (a,b) or (j,k) == (b,a):

                continue

            gg[j].append(k)

    if not chk(gg):

        res += 1

print(res)    
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush
import sys, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    # 根を返す
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]


n, m = inpl()
ab = [0] * m
for i in range(m):
    a, b = inpl()
    ab[i] = (a - 1, b - 1)
res = 0
for _ in range(m):
    uf = UnionFind(n)
    for i in range(m):
        if _ == i:
            continue
        uf.union(ab[i][0], ab[i][1])
    if uf.size(0) != n:
        res += 1
print(res)

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n, m = inpl()
g = [[] for _ in range(n)]
r = dict()
cnt = 0
for _ in range(m):
    a, b = inpl()
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)
    r[cnt] = (a - 1, b - 1)
    cnt += 1
res = 0


def chk(g):
    seen = [False] * n
    seen[0] = True
    q = deque([0])
    while q:
        v = q.popleft()
        for nv in g[v]:
            if seen[nv]:
                continue
            seen[nv] = True
            q.append(nv)
    if sum(seen) == n:
        return True
    return False


for i in range(m):
    gg = [[] for _ in range(n)]
    a, b = r[i]
    for j in range(n):
        for k in g[j]:
            if (j, k) == (a, b) or (j, k) == (b, a):
                continue
            gg[j].append(k)
    if not chk(gg):
        res += 1
print(res)

-from heapq import heapify, heappop, heappush -import sys, bisect, math, itertools, string, queue +from heapq import heappop, heappush, heapify +import sys, bisect, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) +n, m = inpl() +g = [[] for _ in range(n)] +r = dict() +cnt = 0 +for _ in range(m): +    a, b = inpl() +    g[a - 1].append(b - 1) +    g[b - 1].append(a - 1) +    r[cnt] = (a - 1, b - 1) +    cnt += 1 +res = 0 -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) +def chk(g): +    seen = [False] * n +    seen[0] = True +    q = deque([0]) +    while q: +        v = q.popleft() +        for nv in g[v]: +            if seen[nv]: +                continue +            seen[nv] = True +            q.append(nv) +    if sum(seen) == n: +        return True +    return False -class UnionFind: -    def __init__(self, n): -        self.n = n -        self.parents = [-1] * n - -    # 根を返す -    def find(self, x): -        if self.parents[x] < 0: -            return x -        else: -            self.parents[x] = self.find(self.parents[x]) -            return self.parents[x] - -    def union(self, x, y): -        x = self.find(x) -        y = self.find(y) -        if x == y: -            return -        if self.parents[x] > self.parents[y]: -            x, y = y, x -        self.parents[x] += self.parents[y] -        self.parents[y] = x - -    def size(self, x): -        return -self.parents[self.find(x)] - -    def same(self, x, y): -        return self.find(x) == self.find(y) - -    def members(self, x): -        root = self.find(x) -        return [i for i in range(self.n) if self.find(i) == root] - - -n, m = inpl() -ab = [0] * m -    a, b = inpl() -    ab[i] = (a - 1, b - 1) -res = 0 -for _ in range(m): -    uf = UnionFind(n) -    for i in range(m): -        if _ == i: -            continue -        uf.union(ab[i][0], ab[i][1]) -    if uf.size(0) != n: +    gg = [[] for _ in range(n)] +    a, b = r[i] +    for j in range(n): +        for k in g[j]: +            if (j, k) == (a, b) or (j, k) == (b, a): +                continue +            gg[j].append(k) +    if not chk(gg):