from sys import stdin def main(): #入力 readline=stdin.readline a,b,c=map(int,readline().split()) n=min(a,c) m=max(a,c) if max(a,b,c)==b: print(min(b-m,m-n)) elif min(a,b,c)==b: print(min(m-n,n-b)) if __name__=="__main__": main()