Well this is a basic equation of BEDMAS. Therefore this is the operation that you would use for this equation.
40/[1+3-(3x7)+7-5)
= 40/[1+3-21+7-5]
=40/[-15]
= - (8/3)
-2 2/3
If you have any further questions or would like me to explain to be afraid to ask.
Also hope this helped:)