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