using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] su = s.Split('*', '+'); int ans = int.Parse(su[0]); for (int i = 0; i < su.Length - 1; i++) { s = s.Remove(0, su[i].Length); if (s[0] == '*') { ans += int.Parse(su[i + 1]); s = s.TrimStart('*'); } else { ans *= int.Parse(su[i + 1]); s = s.TrimStart('+'); } } Console.WriteLine(ans); Console.ReadLine(); } }