#include <bits/stdc++.h>
using namespace std;
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(15);
}
int isValid(int a, int b, int n, unordered_map<int, int> &firstOccurence,
            unordered_map<int, int> &lastOccurence) {
  if (a < 1 || a > n || b < 1 || b > n) return 0;
  if (firstOccurence.find(b) == firstOccurence.end() ||
      firstOccurence.find(a) == firstOccurence.end())
    return 1;
  if (a == b) return 0;
  if ((firstOccurence.find(a)->second) < (lastOccurence.find(b)->second))
    return 0;
  return 1;
}
int main() {
  FastIO();
  int n, k;
  cin >> n >> k;
  unordered_map<int, int> mp1, mp2;
  for (int i = 0; i < k; i++) {
    int var;
    cin >> var;
    if (mp1.find(var) == mp1.end()) mp1[var] = i;
    mp2[var] = i;
  }
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    int a, b;
    a = i, b = i;
    if (isValid(a, b, n, mp1, mp2)) {
      ans++;
    }
    a = i, b = i - 1;
    if (isValid(a, b, n, mp1, mp2)) {
      ans++;
    }
    a = i, b = i + 1;
    if (isValid(a, b, n, mp1, mp2)) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
