#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxx = 1005;
int df[maxx],low[maxx],flag[maxx];
vector<int> v[maxx];
int cnt = 0,ans = 0;
void tarjan(int x,int pre)
{
flag[x] = 1;
low[x] = df[x] = ++cnt;
for(int i=0;i<v[x].size();i++){
int now = v[x][i];
if(now == pre) continue ;
if(flag[now] != 1) tarjan(now , x);
if(flag[now] == 1) low[x] = min(low[x],low[now]);
}
if(low[x] == df[x])
ans++;
}
int main()
{
int n,m,x,y;
cin>>n>>m;
memset(df,0,sizeof(df));
memset(low,0,sizeof(low));
memset(flag,0,sizeof(flag));
for(int i=1;i<=m;i++){
cin>>x>>y;
v[x].push_back(y);
v[y].push_back(x);
}
tarjan(1 , 1);
cout<<ans - 1<<endl;
return 0;
}