#include <bits/stdc++.h>
using namespace std;
struct qt {
  bool present;
  int lo;
  int hi;
  qt() {
    this->present = false;
    this->lo = -1;
    this->hi = -1;
  }
};
int main() {
  int n, k, temp;
  int count;
  cin >> n >> k;
  count = 0;
  vector<qt> qts(n + 1);
  for (int q = 0; q < k; q++) {
    cin >> temp;
    if (!qts[temp].present) {
      qts[temp].present = true;
      qts[temp].lo = q;
      qts[temp].hi = q;
    } else
      qts[temp].hi = q;
  }
  for (int q = 1; q < n; q++) {
    if (qts[q].present) count++;
    if (qts[q].present and qts[q + 1].present) {
      if (qts[q + 1].lo < qts[q].hi) count++;
      if (qts[q + 1].hi > qts[q].lo) count++;
    }
  }
  if (qts[n].present) count++;
  cout << (n + 2 * (n - 1) - count) << endl;
}
