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