One more note on how to look at it, which is basically what others have said: reinvesting dividends is no different than taking the dividends in cash and buying more of the same fund immediately, if you had the capability to buy as quickly as they do with reinvesting. The accounting is the same: the dividend is taxed, and you have a new purchase that must be tracked (basis for later sale). Fortunately the MF company will track it for you.
And yet another note: another reason to hang onto the lower priced shares is that if you die, your heirs get it at a stepped up basis. So let's say you had 1000 shares at $10 and 1000 shares at $20, and you sold 1000 shares at $30 and died with 1000 shares remaining at a value of $40/share.
If you had sold the $10 shares, you paid taxes on $20,000 capital gains (1000*($30-$10)), and your heirs get 1000 shares which now have a basis of $40,000.
If you had sold the $20 shares, you paid taxes on just $10,000 cap gains (1000*($30-$20)), and your heirs get 1000 shares which have the same basis of $40,000.
If you paid 15% LTCG taxes on the sale, you and your estate came out $1500 ahead in the second case.