#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  map<int, int> first, last;
  int x;
  for (int i = 1; i <= k; ++i) {
    scanf("%d", &x);
    if (first[x] == 0) first[x] = i;
    last[x] = i;
  }
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    if (first[i] == 0) sum++, first[i] = 200000;
    if (first[i] > last[i + 1] && i + 1 <= n) sum++;
    if (first[i] > last[i - 1] && i - 1 >= 1) sum++;
  }
  printf("%d\n", sum);
  return 0;
}
