data_n = input() data_s = data_n.split(" ") Low_n = int(data_s[0]) Rarge_n = int(data_s[1]) M_n = int(data_s[2]) result = 0 for data_M in range(M_n): if Low_n <= Rarge_n: result = result+1 Low_n = Low_n+1 elif result > M_n: result = M_n break print(result)