#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, m, ans = 0;
    cin >> n >> m;
    vector<bool> v(n, 1);
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        v[a] = 0;
    }
    while(v.size() != 1){
        vector<bool> u = v;
        v.clear();
        for(int i = 0; i < u.size(); i += 2){
            if(u[i] & u[i + 1]) ans++;
            v.push_back(u[i] | u[i + 1]);
        }
    }
    cout << ans << endl;
    return 0;
}
