#include <bits/stdc++.h>
using namespace std;
long long mi[100010], mx[100010];
long long n, k, ls;
int main() {
  long long i, jg = 0;
  cin >> n >> k;
  for (i = 0; i <= n; i++) {
    mx[i] = -1;
    mi[i] = 1000000007;
  }
  for (i = 1; i <= k; i++) {
    cin >> ls;
    mx[ls] = max(mx[ls], i);
    mi[ls] = min(mi[ls], i);
  }
  for (i = 1; i <= n; i++) {
    if (mx[i] == -1 && mi[i] == 1000000007) jg++;
    if (i != 1) {
      if (mx[i] < mi[i - 1] || mx[i - 1] == -1 && mi[i - 1] == 1000000007) jg++;
    }
    if (i != n) {
      if (mx[i] < mi[i + 1] || mx[i + 1] == -1 && mi[i + 1] == 1000000007) jg++;
    }
  }
  cout << jg << endl;
  return 0;
}
