What was the lesson Elisha wanted to teach Joash using the arrows?

In 2 Kings 13:14-17 we find that, Joash – the king of Israel, took a bow and some arrows as Elisha told him.

And the 17th verse:

Elisha said, “Open the east window,” and he did so. Elisha said, “Shoot!” and he did so. Elisha said, “This arrow symbolizes the victory the Lord will give you over Syria. You will annihilate Syria in Aphek!”

However, later, in verses 18 and 19 we find the second part of this episode:

Then Elisha said, “Take the arrows,” and he did so. He told the king of Israel, “Strike the ground!” He struck the ground three times and stopped.

The prophet got angry at him and said, “If you had struck the ground five or six times, you would have annihilated Syria! But now, you will defeat Syria only three times.”

What’s the meaning of this story? Where should the king know from that he must strike the ground five or six times?