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