Some of the information in the problem is not needed.

Use Starting share price 33*400=13,200

Subtract out the 1% commission 13,200*.01=13.2

Ending share price 40*400=16,000

Profit is 16,000-13,200 minus the commisions 13,200*.01=13.2, 16,000*.01=16

Total profit =$2,771

Return in 5 months = 2771/13200 = 21%

If you are studying anualized return rates, you may want to convert it to an annual rate.