The simplest way to keep track of your cost basis is to note the amount of dividends on which you're taxed from year to year. By adding those amounts to what you originally paid for shares, you'll accurately reflect your total cost basis for the those stocks.