#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 3;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 3;
void testcase() {
  long long n, k;
  cin >> n >> k;
  long long *a = new long long[k];
  vector<long long> last(n + 1, 0);
  vector<long long> first(n + 1, k + 1);
  for (long long i = 0; i < k; i++) {
    cin >> a[i];
    first[a[i]] = min(i + 1, first[a[i]]);
    last[a[i]] = max(i + 1, last[a[i]]);
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (i - 1 > 0 && last[i - 1] < first[i]) {
      ans++;
    }
    if (i + 1 <= n && last[i + 1] < first[i]) {
      ans++;
    }
    if (last[i] < first[i]) {
      ans++;
    }
  }
  cout << ans << "\n";
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    testcase();
  }
  return 0;
}
