n,m=gets.split.map(&:to_i)
cnt=0
city_array=[]
(1..m).each do |i|
  s,t=gets.split.map(&:to_i)
  city_array << s
  city_array << t
end
(1..n).each do |j|
  if city_array.count(j)==0
    cnt += 2
  elsif city_array.count(j)==1
    cnt += 1
  end
end
ans=2*n-cnt
if cnt<=2
  puts 0
else
   puts ((cnt+1)/2-1)
end