using System; using System.Linq; using System.Collections.Generic; class Program { static void Main() { string s = Console.ReadLine(); var n = s.Split('*', '+').Select(int.Parse).ToArray(); var op = new Queue(); for (int i = 0; i < s.Length; i++) if (!char.IsDigit(s[i])) op.Enqueue(s[i]); int ans = n[0]; for (int i = 1; i < n.Length; i++) { char ope = op.Dequeue(); if (ope == '+') ans *= n[i]; else ans += n[i]; } Console.WriteLine(ans); } }