#include "bits/stdc++.h" #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i> L >> R >> M; out << std::min(R - L + 1, M) << std::endl; }