import algorithm, strutils let n = parseInt readLine stdin a = n mod 10 b = n div 10 mod 10 c = n div 100 list = sorted [a, b, c] echo list[2] - list[0]