S = input().strip() tokens = [] temp_num = '' # Tokenize the input string for c in S: if c.isdigit(): temp_num += c else: tokens.append(int(temp_num)) temp_num = '' tokens.append(c) tokens.append(int(temp_num)) # Add the last number current = tokens[0] # Process each operator and number pair for i in range(1, len(tokens), 2): operator = tokens[i] num = tokens[i + 1] if operator == '*': current += num else: # operator is '+', which means multiplication current *= num print(current)