#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 9e18;
long long n, m, x, ans = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<long long> a(m), cnt(n + 5, 0);
  for (auto& x : a) cin >> x;
  reverse((a).begin(), (a).end());
  vector<vector<long long>> sum(n + 5, vector<long long>(3, 1));
  sum[1][0] = 0;
  sum[n][2] = 0;
  for (auto x : a) {
    cnt[x]++;
    sum[x][1] = 0;
    if (cnt[x + 1]) sum[x][2] = 0;
    if (cnt[x - 1]) sum[x][0] = 0;
  }
  for (long long i = 1; i <= n; i++)
    for (auto x : sum[i]) ans += x;
  cout << ans << endl;
  return 0;
}
