Sort:  

Absolutely. Can you please share the logic as well.

First, I calculated all the additions separately, and then the multiplications, and finally, I added them up.

(4+4+4+4+4+4)+(4×4×0)+(4x4)
24 + 0 + 16
= 40