#include <bits/stdc++.h>
using namespace std;
 
typedef long long               ll;
typedef long double             ld;
 
 
#define racecar          ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time_start		 time_t start, end; time(&start); 
#define time_end		 time(&end);double time_taken=double(end-start);cout <<"\n"<< time_taken*1000<<" ms";
#define si(a)            scanf("%d", &a)
#define si2(a,b)         scanf("%d %d", &a,&b)
#define sll(a)           scanf("%I64d",&a)
#define sll2(a,b)        scanf("%I64d %I64d",&a,&b)
#define pb               push_back
#define pi(a)            printf("%d",int(a))
#define pll(a)           printf("%I64d",ll(a))
#define all(x)           (x).begin(),(x).end()
#define rall(x)          (x).rbegin(),(x).rend()
#define ps               printf(" ")
#define nln              printf("\n")
#define ff               first
#define ss               second
#define vi               vector<int>
#define vll              vector<ll>
#define vstr             vector<string>
#define vc               vector<char>
#define pii              pair<int,int>
#define PLL              pair<ll,ll>
#define PI               acos(-1)
#define sq(x)            x*x
#define forr(i,a,b)      for(ll i=ll(a);i<ll(b);i++)
#define forn(i,a,b)      for(ll i=ll(a);i>ll(b);i--)
#define max3(a,b,c)      max(a,max(b,c))
#define max4(a,b,c,d)    max(max3(a,b,c),d)
#define min3(a,b,c)      min(a,min(b,c))
#define mod              1000000007
#define inf              9223372036854775807

///knight moves:
///int dx[] = {-2, -1, 1, 2, -2, -1, 1, 2}; 
///int dy[] = {-1, -2, -2, -1, 1, 2, 2, 1};

 
ll power(ll b,ll n)
{
    if(n==0) return 1;
    else if(n%2) return b*power(b,n/2)*power(b,n/2);
    else return power(b,n/2)*power(b,n/2);
}
 
ld root(ll n,ll r)
{
    ld dif=0.0001;
    ld guess=n/2.0;
    while(abs(pow(guess,r)-n)>=dif)
    {
        ld temp=pow(guess,r)-n;
        ld tmp=r*pow(guess,r-1);
        guess-=temp/tmp;
    }
    return guess;
}
 
void fileio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
}

vi g[55];
int color[55];
int visited[55];


void bfs(int s)
{
	color[s]=1;
	int u;
	queue<int>q;
	q.push(s);
	while(!q.empty())
	{
		u=q.front();
		q.pop();
		int adj;
		forr(i,0,g[u].size())
		{
			adj=g[u][i];
			if(color[adj]==0)
			{
				color[adj]=1;
				q.push(adj);
			}
		}
	}
}

int solve()
{
	int n,m;
	si2(n,m);
	
	forr(i,0,m)
	{
		int a,b;
		si2(a,b);
		g[a].pb(b);
		g[b].pb(a);
	}
	
	int edge=0;
	
	forr(i,1,n+1)
	{
		int sz=g[i].size();
		//pll(sz);
		//nln;
		visited[i]=1;

		int j=sz-1;
		while(j!=-1)
		{
			int cnt=0;
			forr(k,0,n+1) color[k]=0;
			int temp=g[i][j];
			if(visited[temp]) { j--; continue; }
			g[i].erase(g[i].begin()+j);
			forr(k,0,g[temp].size()) if(g[temp][k]==i) g[temp].erase(g[temp].begin()+k);
			
			//forr(k,1,n+1)
			//{
				//pll(k);
				//printf("-----");
				//forr(p,0,g[k].size()) pll(g[k][p]),ps;
				//nln;
			//}

			
			forr(k,1,n+1) if(color[k]==0) bfs(k),cnt++;
			
			//printf("***%d",cnt);
			
			if(cnt>1) edge++;
			
			g[i].pb(temp);
			g[temp].pb(i);
			j--;
			//nln;
			//nln;
		}
			
	}
			
	
	pll(edge);
				
   	return 0;
}
	
 
int main()
{

//    racecar;
//    cout<<fixed<<setprecision(9);
//    fileio();
    solve();

}

 
 
///    Before submission=>
///    ***check for integer overflow,array bounds
///    ***check for n


Measured memory_bytes: 256