max(min(x + 2, -2x + 4, 4x + 1))