#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;
}
bool check(char a)
{
    return '0'<=a&&a<='9';
}
int main()
{
    freopen("Bai5b.inp","r",stdin);
    freopen("Bai5b.out","w",stdout);
    getline(cin,s);
    for (int i=0;i<s.size();i++)
    {
        if (check(s[i+1]))
            f[t]=f[t]+s[i];
        if (check(s[i]))
        {
            f[t]=f[t]+s[i];
        }
        if (!check(s[i])&&check(s[i+1]))
        {
            t++;
        }
    } // da chuan
    for (int i=0;i<t+1;i++)
    {
        if (f[i][0]!='-'&&ahihi[0]!='-')
        {
            ahihi=add(ahihi,f[i]);//da chuan
        }
    }
    cout<<ahihi;

}

