#include <fstream>

using namespace std;

ifstream f("evaluare.in");
ofstream g("evaluare.out");

char s[100005],*p;

int factor();

int elem();

int termen()
{
    int rez=factor();
    while(*p=='+'||*p=='-')
    {
        if(*p=='+')
        {
             p++;
             rez=rez+factor();
        }
        else
        {
            p++;
            rez=rez-factor();
        }
    }
    return rez;
}
int factor()
{
    int rez=elem();
    while(*p=='*'||*p=='/')
    {
        if(*p=='*')
        {
            p++;
            rez=rez*elem();
        }
        else
        {
            p++;
            rez=rez/elem();
        }
    }
    return rez;
}
int elem()
{
    int rez=0;
    if(*p=='(')
    {
        p++;
        rez=termen();
        p++;
        return rez;
    }

    while(isdigit(*p))
    {
        rez=rez*10+*p-'0';
        p++;
    }
    return rez;
}
int main()
{
    f>>s;
    p=s;
    g<<termen();
    return 0;
}