program school;
var
n,m,i,ans,x,y:longint;
a:array[1..100000]of longint;
begin
assign (input,'sent.in');
reset (input);
assign (output,'sent.out');
rewrite (output);
readln (n);
readln (m);
for i:=1 to m do
begin
readln (x,y);
inc(a[x]);
inc(a[y])
end;
for i:=1 to n do
if a[i] mod 2=0 then
begin
ans:=ans+a[i] div 2-1
end
else
begin
ans:=ans+a[i] div 2
end;
writeln (ans);
close (input);
close (output)
end.