#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a * (b / gcd(a, b));
}
template <typename T>
T sqr(T a) {
  return a * a;
}
template <typename T>
T cube(T a) {
  return a * a * a;
}
template <typename T>
inline void smin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void smax(T &a, T b) {
  a = a > b ? a : b;
}
template <typename T>
void fill(T a[], T n, T b) {
  for (int i = 0; i <= n; i++) a[i] = b;
}
int in() {
  int n;
  scanf("%d", &n);
  return n;
}
long long Lin() {
  long long n;
  scanf("%lld", &n);
  return n;
}
double Din() {
  double n;
  scanf("%lf", &n);
  return n;
}
const long long inf = (long long)1e17;
const long long mod = (long long)1e9 + 7;
const int N = 1e5 + 5;
int a[N];
bool vis[N];
vector<int> pos[N];
int bs(int x, int v) {
  int low = 0, high = (int)pos[v].size() - 1;
  while (low <= high) {
    int mid = (low + high) >> 1;
    if (pos[v][mid] > x)
      return false;
    else
      low = mid + 1;
  }
  return true;
}
int solve() {
  int n = in(), k = in();
  for (int i = 1; i <= k; i++) {
    a[i] = in();
    pos[a[i]].push_back(i);
    vis[a[i]] = 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) ans++;
  }
  for (int i = 1; i <= n; i++) {
    sort(pos[i].begin(), pos[i].end());
  }
  for (int i = 1; i <= n; i++) {
    if (i + 1 <= n) {
      if (pos[i].empty())
        ans++;
      else if (bs(pos[i][0], i + 1))
        ans++;
    }
    if (i - 1 >= 1) {
      if (pos[i].empty())
        ans++;
      else if (bs(pos[i][0], i - 1))
        ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
int main() {
  int test = 1, tc = 0;
  while (test--) {
    solve();
  }
  return 0;
}
