CAC is calculated by dividing total marketing and advertising costs by the number of customers acquired in a certain time.