n, m = gets.chomp.split.map(&:to_i)
match = Array.new(n, 2)
m.times{match[n - 1 - (gets.to_i / 2)] -= 1}
answer = n - 1
(n - 1).downto(1){|i|
    answer -= 1 if match[i] != 2
    match[i / 2] -= 1 if match[i] == 0
}
puts answer
