How to get average price of stock

How do investors calculate the average cost of their stock holdings?