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