Script for calculating share of dynamic bills