Gear Ratio of a Stepped Planetary Gearset

I was looking into planetary gearsets, and came upon the concept of a stepped planetary gearset. In the image shown above, if my input was the blue sun gear, the output was the planet gear, and the ring is assumed to be fixed, how can I go about deriving what the gear ratio would be?

The formula to use is,

• R= Number of teeth in ring gear
• S =Number of teeth in sun (middle) gear
• P= Number of teeth in planet gears

And

• Tr Turns of the ring gear
• Ts Turns of the sun gear
• Ty Turns of the planetary gear carrier (the Y shaped thing )
• R Ring gear teeth
• S Sun gear teeth
• P Planet gear teeth

$$( R + S ) ×Ty = R × Tr + Ts × S$$

$$Tr=0$$

because we assume the ring is not turning.

we calculate for Ty of assuming there were no steps.

$$Ty = Ts\frac{S}{R+S}$$

So we plug this into the ratio of green to red planet gear to get the speed of planetary gear carrier (the Y shaped thing).

$$Ty_{final}= Ty \frac{P_{green}}{P_{red}}$$