Scheduling dispensing and counting in secondary pharmaceutical manufacturing