How to calculate the number of batteries and power