#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;
vector<int> t[N * 4];
void build(int v, int tl, int tr, vector<int> &a) {
  if (tl == tr) {
    t[v].push_back(a[tl]);
  } else {
    int tm = (tl + tr) / 2;
    build(v * 2, tl, tm, a);
    build(v * 2 + 1, tm + 1, tr, a);
    t[v] = t[v * 2];
    for (auto i : t[v * 2 + 1]) {
      t[v].push_back(i);
    }
    sort(t[v].begin(), t[v].end());
  }
}
int get(int v, int tl, int tr, int l, int r, int x) {
  if (l > r) {
    return 0;
  }
  if (tl == l && tr == r) {
    int ind = lower_bound(t[v].begin(), t[v].end(), x) - t[v].begin();
    if (ind != t[v].size() && t[v][ind] == x) {
      return 1;
    } else {
      return 0;
    }
  }
  int tm = (tl + tr) / 2;
  int ql = get(v * 2, tl, tm, l, min(r, tm), x);
  int qr = get(v * 2 + 1, tm + 1, r, max(l, tm + 1), r, x);
  return (ql + qr);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  vector<int> a(k), last(n + 1, k);
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    if (last[a[i]] == k) {
      last[a[i]] = i;
    }
  }
  build(1, 0, k - 1, a);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (last[i] == k) {
      ans++;
    }
    if (i > 1 && get(1, 0, k - 1, last[i], k - 1, i - 1) == 0) {
      ans++;
    }
    if (i < n && get(1, 0, k - 1, last[i], k - 1, i + 1) == 0) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
