One of Warren Buffett's best-known kernels of wisdom is that investors should be fearful when others are greedy, and greedy when others are fearful.

The 86-year-old billionaire has followed his own advice many times in the past, but a recent notable instance was when he invested $5 billion of Berkshire Hathaway's (BRK.A -0.67%) (BRK.B -0.60%) money into Bank of America (BAC -1.42%) in the summer of 2011.

Bank of America's shares were careening lower at the time, eventually bottoming out around $5 a share, approximately a third of their value 18 months earlier.

Chart showing the increase in Berkshire's investment in Bank of America.

Data sources: Bank of America, author's calculations. Chart by author.

Berkshire bought $5 billion worth of preferred stock in the bank, yielding $300 million a year in annual dividends. To sweeten the pot, Bank of America threw in stock options that give Berkshire the right to buy 700 million shares of the bank's common stock for $7.14 each, which is now well below their price of more than $24 a share.

If you add up the value of these components today, Berkshire's $5 billion investment in Bank of America is worth just under $19 billion. It clearly pays to be greedy when others are fearful.

Offer from The Motley Fool: The 10 best stocks to buy now
Motley Fool co-founders Tom and David Gardner have spent more than a decade beating the market. In fact, the newsletter they run, Motley Fool Stock Advisor, has tripled the S&P 500!*

Tom and David just revealed their ten top stock picks for investors to buy right now.

Click here to get access to the full list!

*Stock Advisor returns as of June 5, 2017.