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