Solving a problem with count of available hosts