#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define SZ(a) (int)(a).size() #define FOR(i,a,b) for (int i=(a); i<=(b); ++i) #define REP(i,n) for (int i=0; i<(n); ++i) #define ALL(c) c.begin(), c.end() #define CLR(c,n) memset(c, n, sizeof(c)) #define MCPY(d, s) memcpy(d, s, sizeof(d)) #define TR(it, c) for (auto it = c.begin();it != c.end(); ++it) #define CONTAIN(it, c) (c.find(it) != c.end()) typedef vector VI; typedef pair PII; template void checkmin(T &a, T b) { if (b void checkmax(T &a, T b) { if (b>a) a=b; } typedef long long LL; const int INF=0x3F3F3F3F; int main(int argc, char *argv[]) { int l, r, m; while (cin>>l>>r>>m) cout << min(r-l+1, m) << endl; }