#include <bits/stdc++.h>
using namespace std;
const int limit = 1000000;
int n, m;
int last[limit];
int first[limit];
int v[limit];
int sol;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> v[i];
    last[v[i]] = i;
  }
  for (int i = m; i >= 1; i--) first[v[i]] = i;
  for (int i = 1; i <= n; i++) {
    sol += last[i] == 0;
    sol +=
        i < n and (last[i] == 0 or last[i + 1] == 0 or last[i + 1] < first[i]);
    sol +=
        1 < i and (last[i] == 0 or last[i - 1] == 0 or last[i - 1] < first[i]);
  }
  cout << sol << endl;
}
