func_code_string: #include <bits/stdc++.h>   template <typename T>   inline void read(T& x) {     T res = 0, flag = 1;     char ch;     ch = getchar();     while (!isdigit(ch)) {       if (ch ==  - ) flag = -1;       ch = getchar();     }     while (isdigit(ch)) {       res = res * 10 + ch - 48;       ch = getchar();     }     x = res * flag;   }   const int N = 100000 + 1;   int n, k, x;   bool vis[N], pre[N], suf[N];   int main() {     read(n), read(k);     long long ans = n * 3 - 2;     for (int i = 1; i <= k; ++i) {       read(x);       if (!vis[x]) --ans;       vis[x] = 1;       if (vis[x - 1] && !pre[x]) --ans, pre[x] = 1;       if (vis[x + 1] && !suf[x]) --ans, suf[x] = 1;     }     printf( %lld n , ans);   }   