How is the cost calculated?