#include <iostream>
#include <set>
using namespace std;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n, k;
    cin >> n >> k;

    set <int> s, rs, sums;
    for (int i = 0; i < k; i++){
        int t;
        cin >> t;
        s.insert(t);
        rs.insert(t);
    }

    while (s.find(n) != s.end()){
        s.erase(n);
        rs.erase(n);
        n--;
    }

    while (!s.empty()){
        for (int j = 1; j <= n; j++){
            int t = *s.begin() + j;
            if (sums.find(t) != sums.end())
                continue;

            for (int w = 1; w <= t/2; w++){
                if (rs.find(w) == rs.end() && rs.find(t - w) == rs.end() && t-w <= n){
                    t = -1;
                    break;
                }
            }
            if (t != -1)
                sums.insert(*s.begin() + j);
        }
        s.erase(s.begin());
    }

    cout << 2*n - 1 - sums.size();
}

