#include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int abc; cin >> abc; int c = abc % 10; abc /= 10; int b = abc % 10; abc /= 10; int a = abc % 10; cout << max(a, max(b, c)) - min(a, min(b, c)) << endl; }