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