Calling a Coin You've Never Seen

A casino hands you a coin whose probability of landing heads is some fixed pp, which nobody tells you. The coin will be tossed 100100 times; before each toss you must call a side, collecting $1\$1 whenever your call matches the outcome and nothing otherwise. You are free to adapt your calls based on everything you've observed so far. Playing as well as possible, what is your expected total winnings, expressed in terms of pp?

Answer

Free accounts unlock one worked solution a day. Pro includes every answer.