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 fir_data = int(Rarge_n - Low_n + 1) if fir_data >= M_n: print(M_n) else: print(fir_data)