#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
set<long long int> un;
map<long long int, long long int> first, last;
bool check(long long int a, long long int b) {
  if (last[b] >= first[a]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 1; i <= n; ++i) {
    first[i] = LLONG_MAX;
    last[i] = -1;
  }
  for (long long int i = 0; i < k; ++i) {
    long long int x;
    cin >> x;
    un.insert(x);
    first[x] = min(first[x], i);
    last[x] = max(last[x], i);
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; ++i) {
    if (i != 1) ans += check(i, i - 1);
    if (i != n) ans += check(i, i + 1);
    ans += check(i, i);
  }
  cout << ans << endl;
}
