#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
int n, m, h, l, r, x;
int a[N], b[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) a[i] = m + 1;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    a[x] = min(a[x], i);
    b[x] = max(b[x], i);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += !b[i];
  for (int i = 1; i <= n - 1; i++)
    if (b[i] < a[i + 1]) ++ans;
  for (int i = 1; i <= n - 1; i++)
    if (b[i + 1] < a[i]) ++ans;
  printf("%d\n", ans);
  return 0;
}
