Perimeter and Cost Calculation