#include <bits/stdc++.h>
using namespace std;
int Max[100001], Min[100001], a[100001];
int main() {
  int n, k, ans = 0;
  cin >> n >> k;
  memset(Max, -1, sizeof(Max));
  memset(Min, 0x3f3f3f, sizeof(Min));
  for (int i = 1; i <= k; i++) {
    cin >> a[i];
    Max[a[i]] = max(Max[a[i]], i);
    Min[a[i]] = min(Min[a[i]], i);
  }
  for (int i = 1; i <= n; i++) {
    if (i < 1 || i > n) continue;
    if (Min[i] > Max[i - 1] && i > 1) ans++;
    if (Min[i] > Max[i + 1] && i < n) ans++;
    if (Min[i] > Max[i]) ans++;
  }
  cout << ans;
}
