using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static int sum = 0; public static void Main() { var s = Console.ReadLine(); var i = 0; var a = ""; var k = true; while (i < s.Length) { if (s[i] == '+') { Cal(a, k); k = false; a = ""; } else if (s[i] == '*') { Cal(a, k); k = true; a = ""; } else { a += s[i]; } i++; } Cal(a, k); Console.WriteLine(sum); } public static void Cal(string a,bool k) { if (k) { sum += int.Parse(a); } else { sum *= int.Parse(a); } } } }