#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T>
void readv(vector<T> &v, int x) {
  v = vector<T>(x);
  for (int(i) = int(0); i < int(x); ++i) cin >> (v[i]);
}
int n, k;
vector<int> v;
void _input() {
  cin >> n >> k;
  readv(v, k);
}
bool solve() { return true; }
void _solve() {
  long long ans = n + 2 * (n - 1);
  vector<vector<int>> p(100105);
  for (int(i) = int(0); i < int(k); ++i) {
    int e = v[i];
    p[e].push_back(i);
  }
  for (int(i) = int(0); i < int(100100); ++i)
    if (p[i].size()) --ans;
  for (int(i) = int(0); i < int(n - 1); ++i) {
    int te = i + 1;
    if (te + 1 <= n and p[te].size() and p[te + 1].size()) {
      if (p[te + 1].back() > p[te].front()) --ans;
      if (p[te].back() > p[te + 1].front()) --ans;
    }
  }
  cout << ans << endl;
}
int main() {
  double st = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int qq = 1;
  int cc = 0;
  while (cc++ < qq) {
    _input();
    _solve();
  }
  cerr << 1000.0 * (1.0 * clock() - st) / (1.0 * CLOCKS_PER_SEC)
       << " ms ellapsed\n";
}
