#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, ta, tb, k;
  cin >> n >> k;
  long long int a[k];
  map<long long int, long long int> cnt;
  vector<long long int> l(n, -1e8), f(n, 1e8);
  for (long long int i = 0; i < k; i++) {
    cin >> a[i];
    a[i]--;
    l[a[i]] = max(l[a[i]], i);
    f[a[i]] = min(f[a[i]], i);
  }
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    if (l[i] < f[i]) ans++;
    if (i < n - 1) {
      long long int t1 = i;
      long long int t2 = i + 1;
      if (l[t1] < f[t2]) ans++;
      if (l[t2] < f[t1]) ans++;
    }
  }
  cout << ans << endl;
}
