Calculate number of jobs dynamically.