#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 50;
int a[maxn];
int last[maxn], first[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) first[i] = 0x7fffffff;
  for (int i = 1; i <= m; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    last[a[i]] = i;
    if (first[a[i]] == 0x7fffffff) first[a[i]] = i;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (first[i] > last[i - 1] && i - 1 >= 1) ++ans;
    if (first[i] > last[i + 1] && i + 1 <= n) ++ans;
    if (first[i] == 0x7fffffff) ++ans;
  }
  cout << ans << endl;
  return 0;
}
