abc = [int(i) for i in input().split()] s = sorted(abc) ans = min(s[1]-s[0],s[2]-s[1]) if b == s[1]: ans = 0 print(ans)