# coding: utf-8 # Your code here! A,B,C=map(int,input().split()) ans=[] ans.append(B-A) ans.append(B-C) ans.append(abs(A-C)) #print(ans) print(min(ans))