The key here seems to be to solve for the acceleration of the system of three blocks. The blocks will accelerate in unison. m3 will drop with a (m/s^2). (m1 +m2) will head to the right with the same a (m/s^2).

This being the case, it helps to do a free body diagram with the down directon as positive.

m3g is the force pulling m3 down.

T32 is the tension pulling up on m3.

This means that Fnet = m3g - T32, but Fnet = m3a.

The first equation is m3a = m3g - T32.

On the other side of the pulley, T32 is the force pulling (m1+m2) to the right.

T32 = (m1 +m2) a

Two equations with two unknowns. I choose to solve both equations for T32, then set the two equations equal to each other.

m3g - m3a = m1a+ m2a

Solve for a = m3g / (m1 + m2 + m3).

Do the sniff test! If (m1 +m2) = 0, then a = g. If (m1 + m2) is way larger then a = very small.