calculates number of optional powers