L, R, M = gets.split.map &:to_i p [M, R - L + 1].min