
    Given the number of high-risk patients currently enrolled in the hospital's readmission monitoring program, determine the minimum monitoring system capacity (which must be a power of 2) needed to track all patients effectively. The monitoring system can only be configured with capacities that are powers of 2 due to technical limitations in the patient tracking software, and the chosen capacity must be large enough to accommodate all current patients.
    

    
def next_power_of_2(n):
    """
    Given the number of high-risk patients currently enrolled in the hospital's readmission monitoring program, determine the minimum monitoring system capacity (which must be a power of 2) needed to track all patients effectively. The monitoring system can only be configured with capacities that are powers of 2 due to technical limitations in the patient tracking software, and the chosen capacity must be large enough to accommodate all current patients.
    

    """
def next_power_of_2(n):
    """
    Given the number of high-risk patients currently enrolled in the hospital's readmission monitoring program, determine the minimum monitoring system capacity (which must be a power of 2) needed to track all patients effectively. The monitoring system can only be configured with capacities that are powers of 2 due to technical limitations in the patient tracking software, and the chosen capacity must be large enough to accommodate all current patients.
    

    """
    if n and (not n & n - 1):
        return n
    count = 0
    while n != 0:
        n >>= 1
        count += 1
    return 1 << count