#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <queue>
#include <cstring>
using namespace std;
int N,M,cnt=1,f,t,c,ans;
int head[10001];
bool vis[20002];
struct EDGE{
    int to,next,from;
};
EDGE edge[50005];
void add(int u,int v){
    edge[cnt].from=u;
    edge[cnt].to=v;
    edge[cnt].next=head[u];
    head[u]=cnt++;
}
void dfs(int u){
    vis[u]=true;
    c++;
    for(int i=head[u];i>0;i=edge[i].next){
        if(vis[edge[i].to])continue;
        if((u==f&&edge[i].to==t)||(u==t&&edge[i].to==f))continue;
        dfs(edge[i].to);
    }
}
int main(){
    scanf("%d%d",&N,&M);
    for(int i=1;i<=M;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        add(x,y);add(y,x);
    }
    for(int i=1;i<cnt;i+=2){
        memset(vis,false,sizeof(vis));
        f=edge[i].from;
        t=edge[i].to;
        c=0;
        dfs(f);
        if(c<N)ans++;
    }
    printf("%d",ans);
    return 0;
}