Calculation of Electric Potential Energy for a Group of Charges