program sent;
var a:array[1..100000]of longint;
f,bo:array[1..100000]of longint;
b:array[1..100000]of longint;
t,k,m,n,i,j,x,y:longint;
function top(i:longint):longint;
begin
if f[i]<>i then f[i]:=top(f[i]);
exit(f[i]);
end;
begin
assign(input,'sent.in');
reset(input);
assign(output,'sent.out');
rewrite(output);
readln(n);
readln(m);
for t:=1 to n do
f[t]:=t;
for t:=1 to m do
begin
readln(i,j);
inc(a[i]);
inc(a[j]);
x:=top(i);
y:=top(j);
if x<>y then
f[x]:=y;
end;
k:=0;
fillchar(b,sizeof(b),false);
for t:=1 to n do
begin
x:=top(t);
inc(b[x]);
if odd(a[t]) then inc(bo[x]);
end;
for t:=1 to n do
begin
if bo[t]>2 then k:=k+(bo[t]-2)div 2;
if b[t]>1 then k:=k+1;
end;
dec(k);
writeln(k);
close(output);
end.