deriv - covered call profit at expiration

hi guys, can anyone explain why the covered call’s profit at expiration = min (X, St) - (S0 - C0)? I don’t get it…

Make up numbers is the best way to solve options.

Assume strike is $35, stock is currently 30, call premium was $2. What happens when stock ends up at 25, 30, 35, 40 at expiration?

i see. clear now thanx!

(Profit on Stock) + (Profit on Option) - Cost

(St-X) -Max(0, St-X) -Cost (remember you are short on the call option therefore negative sign on call payoff)

Stock is 25 at expiration (25-30) - Max(0, 25-35) - 2 = -$7

Stock is 40 at expiration (40-30) - Max (0,40-35) -2 = $7