UVA 10550 online judge

Please explain it!!!

I am not getting why the answer of 0 30 0 30 is 1350

Fits every single stereotype of stupid questions.

Please explain Man!!