A cost-benefit analysis of quarantine