#include <bits/stdc++.h>
using namespace std;
long n, k;
long f[300000], l[300000], x, res = 0;
bool kt(long b, long e) {
  if (b == e) {
    if (l[b] == 0)
      return true;
    else
      return false;
  }
  if (f[b] <= l[e])
    return false;
  else
    return true;
}
void build() {
  for (int i = 1; i <= n; i++)
    if (f[i] == 0) f[i] = k + 1;
  if (kt(1, 1)) res++;
  for (int i = 2; i <= n; i++) {
    if (kt(i, i - 1)) res++;
    if (kt(i - 1, i)) res++;
    if (kt(i, i)) res++;
  }
}
int main() {
  scanf("%ld%ld", &n, &k);
  for (long i = 1; i <= k; i++) {
    scanf("%ld", &x);
    if (f[x] != 0)
      f[x] = min(f[x], i);
    else
      f[x] = i;
    if (l[x] != 0)
      l[x] = max(l[x], i);
    else
      l[x] = i;
  }
  build();
  cout << res;
}
