using System; using System.Numerics; namespace _0109 { class Program { static string s; public static int pointer; static BigInteger number() { BigInteger ret = 0; while (pointer < s.Length && '0' <= s[pointer] && s[pointer] <= '9') { ret *= 10; ret += s[pointer] - '0'; pointer++; } return ret; } static BigInteger term() { BigInteger ret = factor(); while (pointer < s.Length) { if (s[pointer] == '*') { pointer++; ret *= factor(); } else if (s[pointer] == '/') { pointer++; ret /= factor(); } else break; } return ret; } static BigInteger expression() { BigInteger ret = term(); while (pointer < s.Length) { if (s[pointer] == '+') { pointer++; ret += term(); } else if (s[pointer] == '-') { pointer++; ret -= term(); } else break; } return ret; } static BigInteger factor() { if (s[pointer] == '(') { pointer++; BigInteger ret = expression(); pointer++; return ret; } else return number(); } static void Main(string[] args) { string[]v = Console.ReadLine().Split(); s = "0" + v[0] + v[1]; pointer = 0; Console.WriteLine(expression()); } } }