He starts with 3 sacks with 30 in each sack.
He has to give 1 coconut per sack away. So at first he gives 3 coconuts away.
The first 10 checkpoints he gives away 30 coconuts, so he is left with 2 sacks.
Now he has to give 2 coconuts away. 30/2 = 15, so the next 15 checkpoints he ends up giving away another full sack, so he is left with 1 full sack of 30 coconuts and he has 5 checkpoints left.
Giving away 1 coconut at those checkpoints, he would have 25 left