Overlay more than one transparent images in one shader
It is easier if you don't think in terms of transparency and think of masks.
(read: Change Color Associated with Transparency? and Add a transparent image on top of a material)

When working with shaders, RGB information and Masks (based on alpha channels) follow separate paths.

So let's break this in two parts.


RGB

Combine the RGB information using the alpha channel of each one of the image being overlaid as a mask (fac), to control the mix over the background image. Note that you don't use the alpha of the very first image in the chain, you overlay the 2nd image using it's alpha channel to control the mix over the 1st one.





Alpha

Then you can use the sum of all of the alpha channels as a mask to control the mix of color or shaders. You can use a Convert>Math node and set it to add mode.

To mix the colors and use them as a shader color:




To control the mix of other shaders: