using System;
using System.Collections.Generic;
using System.Linq;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var vals = IOUtils.ReadInts();
            var pointCount = vals[0];
            var lineCount = vals[1];

            var edges = Enumerable.Repeat(0, lineCount)
                                  .Select(_ => IOUtils.ReadInts())
                                  .Select(a => Tuple.Create(a[0], a[1]))
                                  .ToArray();

            var res = 0;
            foreach (var edge in edges)
            {
                var tmpEdges = edges.ToList();
                if (!tmpEdges.Remove(edge)) throw new InvalidProgramException();

                var graph = new PrimitiveUndirectedGraph(pointCount, tmpEdges);

                if (!graph.IsConnectedDFS())
                {
                    res++;
                }
            }

            Console.WriteLine(res);
        }
    }

    abstract class UndirectedGraph
    {
        public abstract IEnumerable<int[]> EnumeratePathes(int start);
        public abstract bool IsConnectedDFS();

        public abstract bool RemoveEdge(int v1, int v2);

        public abstract bool AddEdge(int v1, int v2);

        public abstract bool HasEdge(int v1, int v2);
    }

    class PrimitiveUndirectedGraph : UndirectedGraph
    {
        readonly int vertexCount;
        readonly HashSet<Tuple<int, int>> edges;

        public PrimitiveUndirectedGraph(int vertexCount, IEnumerable<Tuple<int, int>> edges)
            :base() {
            this.vertexCount = vertexCount;
            this.edges = new HashSet<Tuple<int, int>>(edges.Select(t => t.Item1 < t.Item2 ? t : Tuple.Create(t.Item2, t.Item1)));
        }

        public override bool RemoveEdge(int v1, int v2)
        {
            if (v2 < v1)
            {
                return RemoveEdge(v2, v1);
            }
            return this.edges.Remove(Tuple.Create(v1, v2));
        }

        public override IEnumerable<int[]> EnumeratePathes(int start)
        {
            throw new NotImplementedException();
        }
        public override bool IsConnectedDFS()
        {
            return isConnectedDfs(1, new HashSet<int>());
        }

        private bool isConnectedDfs(int v, HashSet<int> accessed)
        {
            accessed.Add(v);
            if (accessed.Count == this.vertexCount) return true;

            var nexts = this.edges.Where(e => e.Item1 == v || e.Item2 == v);
            foreach (var edge in nexts)
            {
                var v2 = edge.Item1 == v ? edge.Item2 : edge.Item1;
                if (accessed.Contains(v2)) continue;

                if (isConnectedDfs(v2, accessed)) return true;
            }
            return false;
        }

        public override bool AddEdge(int v1, int v2)
        {
            if (v2 < v1)
            {
                return AddEdge(v2, v1);
            }

            return this.edges.Add(Tuple.Create(v1, v2));
        }

        public override bool HasEdge(int v1, int v2)
        {
            if (v2 < v1) return HasEdge(v2, v1);

            return this.edges.Contains(Tuple.Create(v1, v2));
        }
    }


    static class IOUtils
    {
        public static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
        public static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        public static ulong ReadUlong()
        {
            return ulong.Parse(Console.ReadLine());
        }
        public static int[] ReadInts()
        {
            return Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
        }
        public static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(v => long.Parse(v)).ToArray();
        }

        public static void WriteNums(params int[] nums)
        {
            Console.WriteLine(string.Join(" ", nums));
        }
    }
}


Measured memory_bytes: 13780