X,Y,Z=(int(i) for i in input().split()) if X>Z:print(Z) elif Y>Z:print(Z-1) else:print(Z-2)