Preliminary calculation of the cost