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