#include <bits/stdc++.h>
using namespace std;
int n, k, ans, x[100005], pos[100005][2];
int main() {
  scanf("%d%d", &n, &k);
  for (register int i = 1; i <= n; ++i) pos[i][0] = k + 1;
  for (register int i = 1; i <= k; ++i) {
    scanf("%d", &x[i]);
    pos[x[i]][0] = min(pos[x[i]][0], i);
    pos[x[i]][1] = max(pos[x[i]][1], i);
  }
  for (register int i = 1; i <= n; ++i)
    for (register int j = max(1, i - 1); j <= min(n, i + 1); ++j)
      if (pos[i][0] > pos[j][1]) ans++;
  printf("%d\n", ans);
}
