def gcd_steps(a, b):
    """ Return the number of steps needed to calculate GCD(a, b)."""
    # GCD(a, b) = GCD(b, a mod b).
    steps = 0
    while b != 0:
        steps += 1

        # Calculate the remainder.
        remainder = a % b

        # Calculate GCD(b, remainder).
        a = b
        b = remainder

    # GCD(a, 0) is a.
    #return a
    return steps