
    Given a patient's blood test showing 'a' distinct biomarkers and 'b' different wearable device threshold readings, write a function to calculate the total number of shared risk factors that could simultaneously affect both measurements, where risk factors are represented by common divisors between the two values.
    

    
def sum(a, b):
    """
    Given a patient's blood test showing 'a' distinct biomarkers and 'b' different wearable device threshold readings, write a function to calculate the total number of shared risk factors that could simultaneously affect both measurements, where risk factors are represented by common divisors between the two values.
    

    """
def sum(a, b):
    """
    Given a patient's blood test showing 'a' distinct biomarkers and 'b' different wearable device threshold readings, write a function to calculate the total number of shared risk factors that could simultaneously affect both measurements, where risk factors are represented by common divisors between the two values.
    

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