#include <bits/stdc++.h>

using namespace std;
const int maxn = 100+5;
int n,m;
int mp[maxn][maxn];
int mp_l[maxn],mp_r[maxn];
int vis[maxn];
void dfs(int j){
    for(int i=1;i<=n;i++){
        if(!vis[i] && mp[j][i]==1){
            vis[i] = 1;
            dfs(i);
        }
    }
    return;
}
bool is(int j){
    memset(vis,0,sizeof vis);
    mp[mp_l[j]][mp_r[j]] = 0;
    mp[mp_r[j]][mp_l[j]] = 0;
    int cnt = 0;
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            dfs(i);
            cnt++;
        }
    }
    mp[mp_l[j]][mp_r[j]] = 1;
    mp[mp_r[j]][mp_l[j]] = 1;
    if(cnt==1)
        return false;
    else
        return true;
}
int main()
{
    cin >> n >> m;
    int a,b;
    for(int i=0;i<m;i++){
        cin >> a >> b;
        mp[a][b] = 1;
        mp[b][a] = 1;
        mp_l[i] = a;
        mp_r[i] = b;
    }
    int ans = 0;
    for(int i=0;i<m;i++){
        if(is(i))
            ans++;
    }
    cout << ans << endl;
    return 0;
}
