How to calculate average stock price

What is the method to calculate average stock purchase price?