#include #include #include int main(){ int a,b,c,ans; scanf("%d %d %d",&a,&b,&c); if(((a < b)&&(c < b))&&(a != c)){ //printf("%d\n",b-a); if(a < c){ ans = b-c; if(ans > c-a)ans = c-a; }else { ans = b-a; if(ans > a-c)ans = a-c; } } if(ans < 0)ans = 0; printf("%d\n",ans); }