Solving equations with addition and subtraction operations