When Jack went to sell the cow in the market, he met an old man on the way. The old man was willing to buy the cow. He offered five magic beans to Jack, in exchange for the cow. He told Jack that he would become rich with the magic beans. So, Jack got the five magic beans for his cow and returned home happily.