Total Average Cost Formula