Designing the Optimal Length of Working Time