#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
#define Max 10010
vector<int> Graph[Max];
int Low[Max],Num[Max],Padre_Nodo[Max];
bool Visi[Max];
int Act,Ans,Hijos_root,Root;
void DFS(int Padre){
Low[Padre]=Num[Padre]=Act;
Act++;
Visi[Padre]=true;
for(int i=0;i<Graph[Padre].size();i++){
int Hijo=Graph[Padre][i];
if(Visi[Hijo]==false){
Padre_Nodo[Hijo]=Padre;
DFS(Hijo);
if(Padre==Root){
Hijos_root++;
}
if(Low[Hijo]>=Num[Padre] && Padre!=Root){
Ans++;
}
Low[Padre]=min(Low[Padre],Low[Hijo]);
}else if(Padre_Nodo[Padre]!=Hijo && Padre!=Root){
Low[Padre]=min(Low[Padre],Num[Hijo]);
}
}
}
int main(){
int n,m,a,b;
while(cin>>n>>m){
if(n==m && m==0) break;
for(int i=0;i<=n;i++){
Graph[i].clear();
Low[i]=0;
Num[i]=0;
Padre_Nodo[i]=-1;
Visi[i]=false;
}
while(m--){
cin>>a>>b;
Graph[a].push_back(b);
Graph[b].push_back(a);
}
Ans=0; Act=0;
for(int i=1;i<=n;i++){
if(Visi[i]==false){
Root=i; Hijos_root=0;
DFS(Root);
if(Hijos_root>=2) Ans++;
}
}
cout<<Ans<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgTWF4IDEwMDEwCgp2ZWN0b3I8aW50PiBHcmFwaFtNYXhdOwppbnQgTG93W01heF0sTnVtW01heF0sUGFkcmVfTm9kb1tNYXhdOwpib29sIFZpc2lbTWF4XTsKaW50IEFjdCxBbnMsSGlqb3Nfcm9vdCxSb290OwoKdm9pZCBERlMoaW50IFBhZHJlKXsKCUxvd1tQYWRyZV09TnVtW1BhZHJlXT1BY3Q7CglBY3QrKzsKCVZpc2lbUGFkcmVdPXRydWU7Cglmb3I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ZW5kbDsKCX0KCXJldHVybiAwOwp9
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, or enum expected
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cstdio>
^
Main.java:3: error: illegal character: '#'
#include <vector>
^
Main.java:7: error: illegal character: '#'
#define Max 10010
^
Main.java:7: error: class, interface, or enum expected
#define Max 10010
^
Main.java:10: error: class, interface, or enum expected
int Low[Max],Num[Max],Padre_Nodo[Max];
^
Main.java:11: error: class, interface, or enum expected
bool Visi[Max];
^
Main.java:12: error: class, interface, or enum expected
int Act,Ans,Hijos_root,Root;
^
Main.java:14: error: class, interface, or enum expected
void DFS(int Padre){
^
Main.java:16: error: class, interface, or enum expected
Act++;
^
Main.java:17: error: class, interface, or enum expected
Visi[Padre]=true;
^
Main.java:18: error: class, interface, or enum expected
for(int i=0;i<Graph[Padre].size();i++){
^
Main.java:18: error: class, interface, or enum expected
for(int i=0;i<Graph[Padre].size();i++){
^
Main.java:18: error: class, interface, or enum expected
for(int i=0;i<Graph[Padre].size();i++){
^
Main.java:20: error: class, interface, or enum expected
if(Visi[Hijo]==false){
^
Main.java:22: error: class, interface, or enum expected
DFS(Hijo);
^
Main.java:23: error: class, interface, or enum expected
if(Padre==Root){
^
Main.java:25: error: class, interface, or enum expected
}
^
Main.java:28: error: class, interface, or enum expected
}
^
Main.java:30: error: class, interface, or enum expected
}else if(Padre_Nodo[Padre]!=Hijo && Padre!=Root){
^
Main.java:32: error: class, interface, or enum expected
}
^
Main.java:38: error: class, interface, or enum expected
while(cin>>n>>m){
^
Main.java:40: error: class, interface, or enum expected
for(int i=0;i<=n;i++){
^
Main.java:40: error: class, interface, or enum expected
for(int i=0;i<=n;i++){
^
Main.java:40: error: class, interface, or enum expected
for(int i=0;i<=n;i++){
^
Main.java:42: error: class, interface, or enum expected
Low[i]=0;
^
Main.java:43: error: class, interface, or enum expected
Num[i]=0;
^
Main.java:44: error: class, interface, or enum expected
Padre_Nodo[i]=-1;
^
Main.java:45: error: class, interface, or enum expected
Visi[i]=false;
^
Main.java:46: error: class, interface, or enum expected
}
^
Main.java:49: error: class, interface, or enum expected
Graph[a].push_back(b);
^
Main.java:50: error: class, interface, or enum expected
Graph[b].push_back(a);
^
Main.java:51: error: class, interface, or enum expected
}
^
Main.java:52: error: class, interface, or enum expected
Ans=0; Act=0;
^
Main.java:53: error: class, interface, or enum expected
for(int i=1;i<=n;i++){
^
Main.java:53: error: class, interface, or enum expected
for(int i=1;i<=n;i++){
^
Main.java:53: error: class, interface, or enum expected
for(int i=1;i<=n;i++){
^
Main.java:55: error: class, interface, or enum expected
Root=i; Hijos_root=0;
^
Main.java:56: error: class, interface, or enum expected
DFS(Root);
^
Main.java:57: error: class, interface, or enum expected
if(Hijos_root>=2) Ans++;
^
Main.java:58: error: class, interface, or enum expected
}
^
Main.java:61: error: class, interface, or enum expected
}
^
Main.java:63: error: class, interface, or enum expected
}
^
44 errors