using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            //

            int N;int M;
            Multi(out N, out M);

            int[][] edge = new int[M][];
            for(int i = 0; i < M; i++)
            {
                edge[i] = GetIntArray().Select(s => s - 1).ToArray();
            }

            int[][] A = new int[N][];
            for(int i = 0; i < N; i++)
            {
                A[i] = Enumerable.Repeat(0, N).ToArray();
            }

            for(int i = 0; i < M; i++)
            {
                A[edge[i][0]][edge[i][1]] = 1;
                A[edge[i][1]][edge[i][0]] = 1;
            }

            var ans = 0;
            for(int i = 0; i < M; i++)
            {
                var e = edge[i];
                A[e[0]][e[1]] = 0;
                A[e[1]][e[0]] = 0;

                var seen = Enumerable.Repeat(-1, N).ToArray();
                seen[0] = 1;

                var stack = new Stack<int>();
                stack.Push(0);
                while (stack.Count > 0)
                {
                    var n = stack.Pop();
                    for(int j = 0; j < N; j++)
                    {
                        if(A[n][j]==1 && seen[j] == -1)
                        {
                            seen[j] = 1;
                            stack.Push(j);
                        }
                    }
                }

                A[e[0]][e[1]] = 1;
                A[e[1]][e[0]] = 1;

                if (seen.Any(s => s == -1)) ans++;
            }

            Console.WriteLine(ans);

            //
            Console.Out.Flush();
            Console.ReadKey();
        }


        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c, out V d)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<V>(ar[3]);
        }
    }
}

Measured memory_bytes: 13652