import sys L, R, M = input().split() L = int(L) R = int(R) M = int(M) out = 0 for i in range(L, L+M): # print(i) if (i > R): break out += 1 print(out)