a,b,c=map(int,input().split()) print(min(max(a,b,c)-max(a,c),abs(a-c)))