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