#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, M; cin >> N >> M;
    auto mp = vector<int>((1<<8) + 1, 0);
    for (int i = 0; i < M; ++i) {
        int a; cin >> a;
        ++mp[a];
    }
    vector<int> v;
    for (int i = 0; i < N; ++i) if (!mp[i]) v.push_back(i);
    int ans = 0;
    while (v.size() > 1) {
        for (int i = 0; i < v.size(); ++i) v[i] >>= 1;
        for (int i = 0; i <= 1<<8; ++i) {
            int sz = upper_bound(begin(v), end(v), i) - lower_bound(begin(v), end(v), i);
            ans += max(0, sz - 1);
        } 
        v.erase(unique(begin(v), end(v)), end(v));
    }
    cout << ans << endl;
}
