#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int n = 1e5 + 5;
int k = 1e5 + 5;
int x[100005];
vector<int> minim(n + 1);
vector<int> maxim(n + 1);
bool check(int a, int b) {
  if (maxim[b] <= minim[a]) {
    return true;
  } else {
    return false;
  }
}
int main() {
  fast();
  cin >> n >> k;
  vector<pair<int, int>> v;
  for (int i = 2; i <= n - 1; i++) {
    v.push_back({i, i + 1});
    v.push_back({i, i});
    v.push_back({i, i - 1});
  }
  v.push_back({n, n});
  if (n > 1) {
    v.push_back({1, 1});
    v.push_back({1, 2});
    v.push_back({n, n - 1});
  }
  for (int i = 1; i <= n; i++) {
    minim[i] = 1000000007;
    maxim[i] = -1;
  }
  for (int i = 1; i <= k; i++) {
    cin >> x[i];
    minim[x[i]] = min(minim[x[i]], i - 1);
    maxim[x[i]] = max(maxim[x[i]], i);
  }
  int ans = 0;
  for (pair<int, int> p : v) {
    int a = p.first;
    int b = p.second;
    if (check(a, b)) {
      ans++;
    }
  }
  cout << ans << "\n";
}
