How to average stock price

How do you calculate the average purchase price of multiple stock transactions?