#include <iostream>
#include <cstdio>
#define ll long long
using namespace std;
const ll p = 1e9+7;
ll n, m, ans = 0, pow2[5100];
ll nxt[10100], to[10100], top[3100], cnte = 0;
ll del[10100], vis[3100];
void add_edge(int u, int v){
	cnte++;
	nxt[cnte] = top[u];
	to[cnte] = v;
	top[u] = cnte;
}

int main(){
	freopen("barrack.in", "r", stdin);
	freopen("barrack.out", "w", stdout);
	scanf("%lld%lld", &n, &m);
	for(int i = 1; i <= m; i++){
		ll u, v;
		scanf("%lld%lld", &u, &v);
		add_edge(u, v);
		add_edge(v, u);
	}
	pow2[0] = 1;
	tarjan()
	printf("%lld\n", ans);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
