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