For the 1st 10 checkpoints, he has to give 30 coconuts, 1 out of each bag. Having crossed the 10th checkpoint, he is left with 90 - 30, i.e. 60 coconuts with 20 in each bag. He empties out contents of 1 bag, puts 10 coconuts each in the other 2 bags and leaves the 3rd empty bag behind. He now has 60 coconuts in 2 bags with 30 each. He now crosses another 15 checkpoints, giving 2 coconuts at each point. Having crossed the 25th checkpoint, he is left with 60 - 30, i.e. 30 coconuts with 15 in each bag. He empties the contents of 1 bag into the other and leaves the empty bag behind. He now has 1 bag with 30 coconuts. He now crosses the last 5 checkpoints giving 1 coconut at each. Having crossed the 30th and the last checkpoint, he is left with 30 - 5 = 25 coconuts.