X, Y, Z = map(int, input().split(' ')) if X < Y <= Z: print(Z-2) elif X <= Z < Y: print(Z-1)