func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long INF = 1e9;   const long long N = 1e5 + 1;   const long long mod = 1e9 + 7;   const long double eps = 1E-7;   vector<int> a[N];   int n, k, x, ans;   int main() {     ios_base::sync_with_stdio(0);     cin >> n >> k;     for (int i = 1; i <= k; i++) cin >> x, a[x].push_back(i);     for (int i = 1; i <= n; i++) {       if (a[i].size() == 0)         ans += 1 + (i != 1) + (i != n);       else {         x = a[i][0];         if (i != 1)           if (upper_bound(a[i - 1].begin(), a[i - 1].end(), x) == a[i - 1].end())             ans++;         if (i != n)           if (upper_bound(a[i + 1].begin(), a[i + 1].end(), x) == a[i + 1].end())             ans++;       }     }     cout << ans << endl;   }   