
    Given the number of students in a cohort, determine the minimum size of balanced peer support groups needed, where the group size must be a power of 2, such that all students can be accommodated (even if some spots remain empty). The group size should be large enough to include all students while maintaining the power of 2 requirement for balanced peer mentoring structures.
    

    
def next_power_of_2(n):
    """
    Given the number of students in a cohort, determine the minimum size of balanced peer support groups needed, where the group size must be a power of 2, such that all students can be accommodated (even if some spots remain empty). The group size should be large enough to include all students while maintaining the power of 2 requirement for balanced peer mentoring structures.
    

    """
def next_power_of_2(n):
    """
    Given the number of students in a cohort, determine the minimum size of balanced peer support groups needed, where the group size must be a power of 2, such that all students can be accommodated (even if some spots remain empty). The group size should be large enough to include all students while maintaining the power of 2 requirement for balanced peer mentoring structures.
    

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