#include <bits/stdc++.h>
using namespace std;
const int imax = 1e9 + 7;
const long long lmax = 1e18;
vector<int> v, t1, t2;
string s;
int calc() {
  int i, n, k, m, ans = 0;
  cin >> n >> k;
  v.clear();
  t1.clear();
  t2.clear();
  v.resize(n + 1, 0);
  t1.resize(n + 1, k);
  t2.resize(n + 1, -1);
  for (i = 0; i < k; ++i) {
    cin >> m;
    v[m] = 1;
    t1[m] = min(t1[m], i);
    t2[m] = max(t2[m], i);
  }
  ans = (v[1] == 0);
  for (i = 2; i < ((int)v.size()); ++i) {
    if (v[i] == 0) ans++;
    if (v[i - 1] == 0 || v[i] == 0) {
      ans += 2;
      continue;
    }
    if (t2[i - 1] < t1[i] || t2[i] < t1[i - 1]) ans++;
  }
  cout << ans;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  calc();
  cout << endl;
  return 0;
}
