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