#include int main() { int L, R, M; scanf("%d%d%d", &L, &R, &M); int n = R-L+1; if (n > M) n = M; printf("%d\n", n); return 0; }