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