Magic Monkey

Follow the monkey’s instructions and think of a number. Magic Monkey will guess the number. How does he do it?