Calculate the cost

S.php

qff