x,y,z = input().split if x > z: print(int(z)) elif int(x) <= int(z) == int(y): print(int(z) - 1) else: print(int(z) - 2)