L,R,M = map(int,input().split()) if R - L + 1 >= M: print(M) else: print(R- L + 1)