1 var
2 dep,fa,v,c,good,bad:array[0..500005]of longint;
3 i,j,k,l,n,m,m1,m2,ans:longint;
4 b:array[0..1000005,1..2]of longint;
5 procedure ss(x,pre:longint);
6 var i:longint;
7 begin
8 dep[x]:=dep[fa[x]]+1; v[x]:=1;
9 i:=c[x];
10 while i>0 do
11 begin
12 if i xor 1=pre then begin i:=b[i,2]; continue; end;
13 if v[b[i,1]]=0 then
14 begin
15 fa[b[i,1]]:=x; ss(b[i,1],i);
16 good[x]:=good[x]+good[b[i,1]];
17 bad[x]:=bad[x]+bad[b[i,1]];
18 end else
19 begin
20 if dep[b[i,1]]>dep[x] then begin i:=b[i,2]; continue; end;
21 if (dep[x]-dep[b[i,1]])mod 2=1 then
22 begin inc(good[x]); dec(good[b[i,1]]); inc(m1); end
23 else begin inc(bad[x]); dec(bad[b[i,1]]); inc(m2); end;
24 end;
25 i:=b[i,2];
26 end;
27 end;
28 begin
29 readln(n,m);
30 for i:=1 to m do
31 begin
32 readln(j,k);
33 b[i*2,1]:=k; b[i*2,2]:=c[j]; c[j]:=i*2;
34 b[i*2+1,1]:=j; b[i*2+1,2]:=c[k]; c[k]:=i*2+1;
35 end;
36 for i:=1 to n do if v[i]=0 then ss(i,0);
37 if m2=1 then inc(ans);
38 for i:=1 to n do if(fa[i]>0)and(bad[i]=m2)and(good[i]=0)then inc(ans);
39 writeln(ans);
40 end.