#include int main(){ int a,b,c,ans; scanf("%d %d %d",&a,&b,&c); 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); }