#include <bits/stdc++.h>
using namespace std;
int a[100010];
int mn[100010], mx[100010];
int main() {
  int n, m;
  memset(mn, 0x5f, sizeof(mn));
  memset(mx, -1, sizeof(mx));
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", a + i);
    a[i]--;
    mn[a[i]] = min(mn[a[i]], i);
    mx[a[i]] = max(mx[a[i]], i);
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (i > 0 && mx[i - 1] <= mn[i]) res++;
    if (i < n - 1 && mx[i + 1] <= mn[i]) res++;
    if (mx[i] == -1) res++;
  }
  printf("%d\n", res);
}
