On the optimal 'lockdown' during an epidemic