There're

boxes in front of you. You know that each box contains a ball either in white or in black. The probability for a ball to be white is

, and the colors of balls are independent of each other. The PJ King invites you to guess the colors of all balls. PJ King has assigned some costs to the boxes. If we number the boxes from

to

, the cost to open the box

is

, and after a box is opened you can see the ball inside this box.
For sure, there's no way to know all the colors except by opening all boxes. However, Gromah wants to give you some hints. Gromah can tell you secretly the number of black balls among all boxes that have not been opened yet, but you have to pay

cost to get one such hint from Gromah. Anyway, if you're superpowered, you can do it without any hint. What's the mathematical expectation of the minimum cost to figure out all colors of balls?