#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  set<int> s;
  vector<int> a(k + 1), pre(n + 1, k + 1), suf(n + 1, 0);
  for (int i = 1; i <= k; i++) {
    cin >> a[i];
    s.insert(a[i]);
    pre[a[i]] = min(pre[a[i]], i);
    suf[a[i]] = max(suf[a[i]], i);
  }
  int ans = n - ((int)(s.size()));
  for (int i = 1; i <= n; i++) {
    if (i + 1 <= n) {
      if (pre[i] > suf[i + 1]) ans++;
    }
    if (i - 1 > 0) {
      if (pre[i] > suf[i - 1]) ans++;
    }
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  double t1 = clock();
  int t;
  t = 1;
  while (t--) solve();
  cerr << setprecision(10) << (clock() - t1) / CLOCKS_PER_SEC << "\n";
  return 0;
}
