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