using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { string S = Console.ReadLine(); int ans = 0; Ty T = Ty.puls; string SS = ""; for(int i = 0; i < S.Length; i++) { if (S[i] == '*') { if (T == Ty.puls) { ans += int.Parse(SS); } else { ans *= int.Parse(SS); } T = Ty.puls; SS = ""; } else if (S[i] == '+') { if (T == Ty.puls) { ans += int.Parse(SS); } else { ans *= int.Parse(SS); } SS = ""; T = Ty.kakeru; } else { SS += S[i]; } } if (T == Ty.puls) { ans += int.Parse(SS); } else { ans *= int.Parse(SS); } Console.WriteLine(ans); } } public enum Ty { puls, kakeru }