#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn=100010;
int n,m,cnt,H1,H2,ans;
int to[maxn<<2],next[maxn<<2],vis[maxn<<2],val[maxn<<1],head[maxn],dep[maxn],h1[maxn],h2[maxn];
inline int z(int x){ return x>0?x:-x;}
int rd()
{
int ret=0,f=1; char gc=getchar();
while(gc<‘0‘||gc>‘9‘) {if(gc==‘-‘)f=-f; gc=getchar();}
while(gc>=‘0‘&&gc<=‘9‘) ret=ret*10+gc-‘0‘,gc=getchar();
return ret*f;
}
void add(int a,int b)
{
to[cnt]=b,next[cnt]=head[a],head[a]=cnt++;
}
void dfs(int x)
{
for(int i=head[x];i!=-1;i=next[i])
{
if(vis[i]) continue;
vis[i^1]=1;
if(!dep[to[i]]) dep[to[i]]=dep[x]+1,dfs(to[i]),h1[x]+=h1[to[i]],h2[x]+=h2[to[i]];
else if((dep[x]-dep[to[i]])&1) H2++,h2[x]++,h2[to[i]]--;
else H1++,h1[x]++,h1[to[i]]--;
}
}
int main()
{
n=rd(),m=rd();
int i,a,b;
memset(head,-1,sizeof(head));
for(i=1;i<=m;i++) a=rd(),b=rd(),add(a,b),add(b,a);
for(i=1;i<=n;i++) if(!dep[i]) dep[i]=1,dfs(i);
for(i=0;i<cnt;i+=2)
{
a=to[i],b=to[i^1];
if(dep[a]<dep[b]) swap(a,b);
if(dep[a]==dep[b]+1)
{
if(h1[a]==H1&&!h2[a]) ans++;
}
else if(!((dep[a]-dep[b])&1)&&H1==1) ans++;
}
printf("%d",ans);
return 0;
}