#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; int ma = -1, mi = 10; for (int i = 0; i < 3; i++) { ma = max(ma, s[i] - '0'); mi = min(mi, s[i] - '0'); } cout << ma - mi << endl; return 0; }