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