The rules for deciding the order to evaluate arithmetic expressions, no matter how complex, are called the order of operations. The complete order of operations in math is:
Contents of parentheses (and other grouping symbols) from the inside out
Powers from left to right
Multiplication and division from left to right
Addition and subtraction from left to right