The next guy wakes up, realizes that remaining number is still not divisible by 5, but if he gives a coconut to the monkey, who now holds 2 coconuts, then the remainder is divisible by 5, so he takes his 5th and hides it in a safe place. 