def main(): x, y, z = map(int, input().split()) if x <= z and y <= z: print(z - 2) elif x <= z or y <= z: print(z - 1) else: print(z) if __name__ == "__main__": main()