Gather your friends and Practice it
The captain always proposes a distribution of the loot. All pirates vote on the proposal, and if half the crew or more go agree with him, the loot is divided as proposed, as no pirate would be willing to take on the captain without superior force on their side.
If the captain fails to obtain support of at least half his crew (which includes himself), he faces a mutiny, and all pirates will turn against him and make him walk the plank. The pirates start over again with the next senior pirate as captain.
What is the maximum number of coins the captain can keep without risking his life?