#include <bits/stdc++.h>
using namespace std;
string s,f[1000000]="",ahihi="0";
int carry,t=0;
string add(string a,string b)
{
    string c;
    int sum,x,y;
    while (a.size()>b.size())
    {
        b='0'+b;
    }
    while (b.size()>a.size())
    {
        a='0'+a;
    }
    for (int i=a.size()-1;i>=0;i--)
    {
        x=int(a[i])-int('0');
        y=int(b[i])-int('0');
        sum=x+y+carry;
        carry=sum/10;
        c=char(sum%10+48)+c;
    }
    if (carry>0) c='1'+c;
    return c;
}
string sub(string a,string b)
{
    string c;
    int s,borrow=0;
    while (a.size()<b.size()) a='0'+a;
    while (b.size()<a.size()) b='0'+b;
    for (int i=a.size()-1;i>=0;i--)
    {
        s=int (a[i])- int (b[i])- borrow;
        if (s<0)
        {
            s=s+10;
            borrow=1;
        }
        if (s>0)
        {
            borrow=0;
            c=char(s+48)+c;
        }
    }
    int k=c.size();
    int d=0;
    while (k>1&&c[d]=='0')
    {
        d++;
        k--;
    }
    c=c.substr(d,k);
    return c;
}
bool check(char a)
{
    return '0'<=a&&a<='9';
}
int cmb(string a,string b)
{
    int m,n;
    //if (a[0]=='-') m=1;
    //if (b[0]=='-')
    while (a.size()<b.size()) a='0'+a;
    while (b.size()<a.size()) b='0'+b;
    for (int i=0;i<a.size();i++)
    {
        if (int(a[i])>int(b[i]))
            return 1;
        if (int (a[i])<int (b[i]))
            return -1;
    }
    return 0;
}
int main()
{
    freopen("Bai5b.inp","r",stdin);
    freopen("Bai5b.out","w",stdout);
    getline(cin,s);
    for (int i=0;i<s.size();i++)
    {
        if (s[i]=='-'&&check(s[i+1]))
            f[t]=f[t]+s[i];
        if (check(s[i]))
        {
            f[t]=f[t]+s[i];
        }
        if (!check(s[i])&&s[i]!='-'&&check(s[i+1])||(!check(s[i])&&s[i+1]=='-'&&check(s[i+2])))
        {
            t++;
        }
    } // da chuan
    for (int i=0;i<t+1;i++)
    {
        if (f[i][0]!='-'&&ahihi[0]!='-')
        {
            ahihi=add(ahihi,f[i]);//da chuan
        }
        else if (f[i][0]=='-'&&ahihi[0]!='-')
        {
            f[i]=f[i].substr(1,f[i].size()-1);
            if (cmb(ahihi,f[i])==1)
            {
                ahihi=sub(ahihi,f[i]);
            }
            else
            {
                if (cmb(ahihi,f[i])==-1)
                {
                    cout<<-1<<endl;
                    ahihi=sub(f[i],ahihi);
                    ahihi='-'+ahihi;
                }
                else if (cmb(ahihi,f[i])==0)
                {
                    cout<<00<<endl;
                    ahihi="0";
                }
            }
            cout<<ahihi<<endl;
        } // da chuan
        else if (f[i][0]=='-'&&ahihi[0]=='-')
        {
            f[i]=f[i].substr(1,f[i].size()-1);
            ahihi=ahihi.substr(1,ahihi.size()-1);
            ahihi=add(ahihi,f[i]);
            ahihi='-'+ahihi;
            cout<<ahihi<<endl;
        } //da chuan
        else if (f[i][0]!='-'&&ahihi[0]=='-')
        {
            ahihi=ahihi.substr(1,ahihi.size()-1);
            cout<<ahihi<<" "<<f[i]<<endl;
            if (cmb(ahihi,f[i])==1)
            {
                ahihi=sub(ahihi,f[i]);
                ahihi='-'+ahihi;
            }
            else
            {
                if (cmb(ahihi,f[i])==-1)
                {
                    ahihi=sub(f[i],ahihi);
                }
                else if (cmb(ahihi,f[i])==0)
                {
                    ahihi="0";
                }
            }
        }
    }
    cout<<ahihi;

}

