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