#include using namespace std; signed main(){ int x, y, d; cin >> x >> y >> d; int a = -1; int lb = 0, rb = x; while( lb <= rb ){ int mid = lb + rb >> 1; if( mid + y >= d ) a = mid, lb = mid + 1; else rb = mid - 1; } if( a == -1 ) cout << 0 << endl, exit( 0 ); int b = -1; lb = 0, rb = x; while( lb <= rb ){ int mid = lb + rb >> 1; if( mid + y >= d ) b = mid, rb = mid - 1; else lb = mid + 1; } cout << a - b + 1 << endl; return 0; }