import std; import core.bitop; import core.checkedint; import core.time; const dx = [-1, 1, 0, 0]; const dy = [0, 0, -1, 1]; void main() { auto a = readln.chomp.split("").to!(int[]); a.sort; writeln(a[2] - a[0]); } pragma(inline) string yes(const bool b) pure @nogc nothrow @safe { return b ? "Yes" : "No"; } pragma(inline) bool range(const int a, const int x, const int b) pure @nogc nothrow @safe { return a <= x && x < b; }