#include<stdio.h>
#define MAXM 55

int N,M,Ans,a[MAXM],b[MAXM],fa[MAXM],Cnt;

int gf(int x)
{
	if(fa[x]!=x)fa[x]=gf(fa[x]);
	return fa[x];
}

void Merge(int x,int y)
{
	int fx=gf(x),fy=gf(y);
	if(fx==fy)return;
	fa[fx]=fy;
	Cnt--;
}

int main()
{
	int i,j;
	
	scanf("%d%d",&N,&M);
	for(i=1;i<=M;i++)scanf("%d%d",&a[i],&b[i]);
	
	for(i=1;i<=M;i++)
	{
		for(j=1;j<=N;j++)fa[j]=j;
		Cnt=N;
		
		for(j=1;j<=M;j++)
		{
			if(j==i)continue;
			Merge(a[j],b[j]);
		}
		
		if(Cnt!=1)Ans++;
	}
	
	printf("%d",Ans);
}