X, Y, Z = map(int, input().split()) ANSWER = Z if X <= Z: ANSWER -= 1 if Y <= Z: ANSWER -= 1 print(ANSWER)