#include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { string s; cin >> s; int a = s[0] - '0'; int b = s[1] - '0'; int c = s[2] - '0'; cout << max(a, max(b, c)) - min(a, min(b, c)) << endl; return 0; }