#include <iostream>
#include <cstdio>

using namespace std;
const int MX = 50+10;
int mp[MX][MX];
int vis[MX];

int main()
{
    int n, m;
    int ans = 0;
    scanf("%d%d", &n, &m);
    for(int i = 1; i <= m; ++i)
    {
        int a, b;
        scanf("%d%d", &a, &b);
        vis[a]++; vis[b]++;
        mp[a][b] = mp[b][a] = 1;
    }
    while(true)
    {
        int pos;
        bool flag = true;
        for(int i = 1; i <= n; ++i)
        {
            if(vis[i] == 1)
            {
                ans++;
                flag = false;
                pos = i;
                vis[i]--;
                break;
            }
        }
        if(flag) break;
        for(int i = 1; i <= n; ++i)
        {
            if(mp[pos][i] == 1)
                vis[i]--;
        }
    }
    printf("%d\n", ans);
}
