a,b,c=map(int,input().strip('')) print(max(a,b,c)-min(a,b,c))