#include <cstdio>
using namespace std;
int a[100001]={0};
int main(void)
{
freopen("sent.in","r",stdin);
freopen("sent.out","w",stdout);
int i,n,m,temp,maxtemp=0,total=0;
scanf("%d\n%d\n",&n,&m);
m+=m;
for (i=1;i<=m;i++)
{
scanf("%d",&temp);
a[temp]++;
if (temp>maxtemp)
maxtemp=temp;
}
for (i=1;i<=maxtemp;i++)
{
if ((a[i]&1)==1)
total++;
}
total-=2;
total=(total+1)/2;
if (total<0)
total=0;
printf("%d\n",total);
fclose(stdin);
fclose(stdout);
return(0);
}