#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)





int N, M;
int A[1010];
//-----------------------------------------------------------------------------------
int ans = 0;
int f(int L, int R) {
	if (L == R) return A[L];

	int d = R - L + 1;
	int a = f(L, L + d / 2 - 1);
	int b = f(L + d / 2, R);
	if (a && b) ans++;
	if (!a && !b) return 0;
	return 1;
}
//-----------------------------------------------------------------------------------
int main() {
	cin >> N >> M;
	rep(i, 0, N) A[i] = 1;
	rep(i, 0, M) {
		int a; cin >> a; A[a] = 0;
	}

	f(0, N - 1);
	cout << ans << endl;
}