#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int sum, suf, pre, max;
} Node;
int toint(const string &s) {
  stringstream ss;
  ss << s;
  int x;
  ss >> x;
  return x;
}
const int MAXN = 3010;
const int UP = 31;
const long long int highest = 1e18;
const double pi = acos(-1);
const double Phi = 1.618033988749894;
const int logn = 20;
const double phi = 0.618033988749894;
const double root5 = 2.236067977;
const int inf = 1e9;
const double inff = 1e9;
const int mod = 998244353;
const int N = 1e5 + 100;
int fa[N];
int la[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    fa[i] = inf;
    la[i] = -inf;
  }
  int ans = 0;
  for (int i = 0; i < m; ++i) {
    int x;
    scanf("%d", &x);
    --x;
    fa[x] = min(fa[x], i);
    la[x] = max(la[x], i);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i - 1; j <= i + 1; ++j) {
      if (j < 0 || j >= n) continue;
      if (fa[i] > la[j]) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
