#include <bits/stdc++.h>
using namespace std;
long long int fir[100007];
long long int last[100007];
void solve() {
  long long int n, k;
  cin >> n >> k;
  long long int x[k];
  for (long long int i = 1; i <= k; i++) {
    long long int t;
    cin >> t;
    if (fir[t] == 0) {
      fir[t] = i;
      last[t] = i;
    } else {
      last[t] = i;
    }
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int p = i;
    for (long long int q = max(1ll, p - 1); q <= min(p + 1, n); q++) {
      if (p == q) {
        if (fir[p] == 0) {
          ans++;
        }
      } else if (fir[p] == 0 and fir[q] == 0) {
        ans++;
      } else if (fir[p] == 0 and fir[q] != 0) {
        ans++;
      } else if (fir[p] != 0 and fir[q] == 0) {
        ans++;
      } else if (fir[p] != 0 and fir[q] != 0) {
        ans += (last[q] < fir[p]);
      }
    }
  }
  cout << ans << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int t = 1;
  while (t--) {
    solve();
  }
}
