Order of Operations for a Complex Math Problem