func_code_string: #include <bits/stdc++.h>   using namespace std;   inline char gc() {     static char buf[1 << 14], *p1 = buf, *p2 = buf;     return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 14, stdin), p1 == p2)                ? EOF                : *p1++;   }   inline long long read(long long &x) {     x = 0;     bool f = 1;     char c = gc();     for (; !isdigit(c); c = gc()) {       if (c ==  - ) f ^= 1;       if (c == EOF) return EOF;     }     for (; isdigit(c); c = gc()) x = (x << 1) + (x << 3) + (c ^ 48);     x = f ? x : -x;     return 1;   }   inline void wr(long long x) {     if (x < 0) putchar( - ), x = -x;     if (x > 9) wr(x / 10);     putchar(x % 10 | 48);   }   const long long N = 1e5 + 10;   long long n;   long long a[N], ans;   int main() {     read(n);     for (long long i = 1, x; i <= n; ++i) read(a[i]);     sort(a + 1, a + 1 + n);     for (long long i = 2; i <= n; ++i)       if (a[i] - a[i - 1] > 1) ans += a[i] - a[i - 1] - 1;     wr(ans);     return 0;   }   