(let ((l(read)) (r(read)) (m(read))) (write (min m r-l+1)) )