#include <bits/stdc++.h>
using namespace std;
map<long long, long long> indexend;
map<long long, long long> indexbegin;
int visited[1000000];
int main(void) {
  int numpos, qus;
  cin >> numpos >> qus;
  long long *q = new long long[qus];
  ;
  set<long long> dist;
  for (long long i = 0; i < qus; i++) {
    cin >> q[i];
    if (indexbegin[q[i]] == 0) indexbegin[q[i]] = i + 1;
    indexend[q[i]] = i + 1;
    dist.insert(q[i]);
  }
  int add = 0;
  int sub = (indexend[1] == 0) + (indexend[numpos] == 0);
  for (int i = 0; i < qus; i++) {
    if (visited[q[i]] == 1) continue;
    visited[q[i]] = 1;
    if (q[i] != numpos && indexbegin[q[i]] > indexend[q[i] + 1]) {
      add++;
    }
    if (q[i] != 1 && indexbegin[q[i]] > indexend[q[i] - 1]) {
      add++;
    }
  }
  cout << (numpos - dist.size()) * 3 + add - sub;
}
