Tom buys 20 shares of a stock that costs $3 each.  He sells 10 of those shares for $4 each.  The rest of the shares end up doubling in value.  How much profit does he make?
He spends 3*20=$<T>multiply(3, 20)=60 on the shares.
He sells 10 for 10*4=$<T>multiply(10, 4)=40
He sells the other 20-10=<T>subtract(20, 10)=10 for a higher valuation.
Their price was 3*2=$<T>multiply(3, 2)=6
So he got 10*6=$<T>multiply(10, 6)=60 from those.
So in total, he got 60+40=$<T>add(60, 40)=100
So his profit was 100-60=$<T>subtract(100, 60)=40
