Implement a function that parses a custom string representation of a math problem and evaluates its basic arithmetic operations.