using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";
    readonly string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    int N, M;
    void solve()
    {
        N = cin.nextint;
        M = cin.nextint;
        var A = new int[M];
        var B = new int[M];
        for (int i = 0; i < M; i++)
        {
            A[i] = cin.nextint - 1;
            B[i] = cin.nextint - 1;
        }
        int ans = 0;
        for (int r = 0; r < M; r++)//使わない辺
        {
            D = new long[N, N];
            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    D[i, j] = inf;
                    if (i == j) D[i, j] = 0;
                }
            }
            for (int i = 0; i < M; i++)
            {
                if (i == r) continue;
                D[A[i], B[i]] = 1;
                D[B[i], A[i]] = 1;
            }
            warshall_floyd(N);
            bool flag = false;
            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    if (D[i, j] == inf)
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag) break;
            }
            if (flag)
            {
                ans++;
            }
        }
        WriteLine(ans);
    }

    long[,] D;
    const long inf = long.MaxValue / 3;
    void input(int n, int m)
    {
        D = new long[n, n];
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                D[i, j] = inf;
                if (i == j) D[i, j] = 0;
            }
        }
        for (int i = 0; i < m; i++)
        {
            int a = cin.nextint - 1;
            int b = cin.nextint - 1;
            long c = cin.nextlong;
            D[a, b] = Math.Min(D[a, b], c);
            D[b, a] = c;
        }
    }
    void warshall_floyd(int n)
    {
        for (int k = 0; k < n; k++)
        {
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    D[i, j] = Math.Min(D[i, j], D[i, k] + D[k, j]);
                }
            }
        }
    }
}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 13268