Question 1205384
.


        Assuming that the cubes are all of the same size . . . 


                    and are stacked face to face . . . 



Take surface area of one cube ( = 6 times the area of one individual face).


Multiply it by the number of cubes.


From this product, subtract the area of one individual face, multiplied by the number of mutually attached individual faces.



The final result will be the sought surface area.




                    Or use another method



In the stacked shape/volume/solid, mark every face, which looks outside.


Then count all the marked faces and count their number.


After that, multiply the area of one/any face by the number of marked faces.