#include <bits/stdc++.h>
#pragma GCC optimize("-Ofast", "-funroll-all-loops")
using namespace std;
long long int CeilIndex(std::vector<long long int>& v, long long int l,
                        long long int r, long long int key) {
  while (r - l > 1) {
    long long int m = l + (r - l) / 2;
    if (v[m] > key)
      r = m;
    else
      l = m;
  }
  return r;
}
long long int LongestIncreasingSubsequenceLength(
    std::vector<long long int>& v) {
  if (v.size() == 0) return 0;
  std::vector<long long int> tail(v.size(), 0);
  long long int length = 1;
  tail[0] = v[0];
  for (size_t i = 1; i < v.size(); i++) {
    if (v[i] < tail[0])
      tail[0] = v[i];
    else if (v[i] >= tail[length - 1])
      tail[length++] = v[i];
    else
      tail[CeilIndex(tail, -1, length - 1, v[i])] = v[i];
  }
  return length;
}
bool check(int m, vector<pair<int, int>> v) {
  int f = 0;
  for (int i = 0; i < v.size(); i++) {
    int x = v[i].first;
    int y = v[i].second;
    if (x > m && y > m) {
      f = 1;
      break;
    }
  }
  if (f == 1)
    return false;
  else
    return true;
}
vector<long long int> v[1000001];
long long int vis[1000001];
vector<long long int> temp;
long long int ans, cc, n;
long long int dfs(long long int x) {
  if (vis[x]) return 0;
  vis[x] = cc;
  long long int ans = (x < n ? 1 : 0);
  for (long long int i = 0; i < v[x].size(); i++) {
    ans = ans + dfs(v[x][i]);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  long long int f[n];
  long long int l[n];
  for (long long int i = 0; i < n; i++) {
    f[i] = 1e9;
    l[i] = -1e9;
  }
  for (long long int i = 0; i < k; i++) {
    long long int x;
    cin >> x;
    x--;
    f[x] = min(f[x], i);
    l[x] = max(l[x], i);
  }
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i - 1; j <= i + 1; j++) {
      if (j < 0 || j >= n) continue;
      if (f[i] > l[j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
