#include <bits/stdc++.h>
using namespace std;
int main() {
  const int INF = 1e6;
  int n, k;
  cin >> n >> k;
  vector<int> x(k), time_first(n, INF), time_last(n, -INF);
  for (int i = 0; i < k; ++i) {
    cin >> x[i];
    --x[i];
    time_first[x[i]] = min(time_first[x[i]], i + 1);
    time_last[x[i]] = max(time_last[x[i]], i + 1);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (time_first[i] == INF) ++ans;
  }
  for (int i = 1; i < n; ++i) {
    if (time_first[i] > time_last[i - 1]) ++ans;
    if (time_first[i - 1] > time_last[i]) ++ans;
  }
  cout << ans;
  return 0;
}
