Potential of the outer plates must be same after connecting the plates. The charges produced on the central plate on the two faces must be such that the electric field on the left side of the plate must be double of that on right, so that the potential drop along the two sides is equal.
Hence charge on the left side of the central plate is

and that on right is

.
Since facing sides have equal and opposite charges, the right side of leftmost plate has charge

and the left side of rightmost plate has charge

.
Since the outer plates have equal charges and the total charge of outermost plates must be

, let the charge be

.
Hence


Total charge on rightmost plate is, thus, equal to

Initial chage on this plate was 0. Hence this is also the amount of charge that has flown into it.