On the forms action page, you could add code to count the number of times the form is submitted:
<?php
@session_start();
if(!(isset($_SESSION['submitCount']))) $_SESSION['submitCount'] = 0;
if($_SERVER['REQUEST_METHOD'] == "POST") $_SESSION['submitCount']++;
?>
then use $_SESSION['submitCount'] for calculating the cost