Measuring the gain from labor specialization