If you had invested $1,000 in each of just three companies back in the 1980s — Apple, Microsoft and M&T Bank — you would be a millionaire today.

That's according to Standard and Poor's Howard Silverblatt, who calculated as follows, using data through the end of 2016:

If you put $1,000 in Apple in 1980, you would have $228,113

If you put $1,000 in Microsoft in 1987, you would have $546,996

And if you put $1,000 in M&T in 1980, you would have $640,948