#include <bits/stdc++.h>

using namespace std;

ifstream fi ("Bai5b.inp");
ofstream fo ("Bai5b.out");

int main(){
   string s;
   std:getline(fi,s);
   string sum="";
   long long i=0,num=0,a;
   for (i=0;i<s.length();i++){
        while (s[i]==' '&&s[i+1]==' '){s.erase(i,1);}
   }
   if (s[0]==' '){s.erase(0,1);}
   if (s[s.length()-1]==' '){s.erase(s.length()-1,1);}
   for (i=0;i<s.length();i++){
    if ('0'<=s[i]&&s[i]<='9'){sum=sum+s[i];}
    else {a=atoi(sum.c_str());num=num+a;sum="";}
   }
   a=atoi(sum.c_str());num=num+a;
   fo<<num;
}


