
    In a hospital emergency room, develop a function that calculates the total number of possible patient group sizes that could be efficiently handled by both the current waiting patients and available medical staff, where each group size must evenly divide both the total number of waiting patients and available staff members. This calculation helps optimize patient distribution and staff allocation during peak hours.
    

    
def sum(a, b):
    """
    In a hospital emergency room, develop a function that calculates the total number of possible patient group sizes that could be efficiently handled by both the current waiting patients and available medical staff, where each group size must evenly divide both the total number of waiting patients and available staff members. This calculation helps optimize patient distribution and staff allocation during peak hours.
    

    """
def sum(a, b):
    """
    In a hospital emergency room, develop a function that calculates the total number of possible patient group sizes that could be efficiently handled by both the current waiting patients and available medical staff, where each group size must evenly divide both the total number of waiting patients and available staff members. This calculation helps optimize patient distribution and staff allocation during peak hours.
    

    """
    sum = 0
    for i in range(1, min(a, b)):
        if a % i == 0 and b % i == 0:
            sum += i
    return sum