n,m=gets.split.map(&:to_i)
city_array=[]
(0..n-1).each do |j|
  city_array[j]=2
end

(1..m).each do |i|
  s,t=gets.split.map(&:to_i)
  if city_array[s-1]>0
    city_array[s-1] -=1
  end
  if city_array[t-1]>0
    city_array[t-1] -=1
  end
end
puts (city_array.sum+1)/2 -1