#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int l, r, m; cin >> l >> r >> m; cout << min(m, r - l + 1) << endl; return 0; }