How to become a millionaire by investing in the S&P500