#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
struct node {
  int fir;
  int las;
} s[N];
int n, k;
int x[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= n; i++) {
    s[i].fir = s[i].las = 0;
  }
  for (int i = 1; i <= k; i++) {
    if (s[x[i]].fir) continue;
    s[x[i]].fir = i;
  }
  for (int i = k; i >= 1; i--) {
    if (s[x[i]].las) continue;
    s[x[i]].las = i;
  }
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i].fir == 0) res++;
  }
  for (int i = 1; i <= n - 1; i++) {
    int j = i + 1;
    if (s[i].fir == 0 || s[j].fir == 0) {
      res += 2;
      continue;
    }
    if (s[i].fir > s[j].las) {
      res++;
    }
    if (s[j].fir > s[i].las) {
      res++;
    }
  }
  cout << res << endl;
  return 0;
}
