728x90
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
int isNumeric(std::string const &str)
{
std::vector<int> nums;
std::string s;
for(int i=0;i<str.size();i++){
if(std::isdigit(str[i])){
if(s.size()==0 && str[i]=='0'){
continue;
}
s= s+str[i];
if(i==str.size()-1){
nums.push_back(std::stoi(s));
}
}else{
if(s.size()!=0){
nums.push_back(std::stoi(s));
}
s="";
}
}
int sum=0;
for(auto &p:nums){
sum+=p;
}
return sum;
}
int main()
{
std::string str;
std::cin>>str;
int ans = isNumeric(str);
std::cout<<ans;
return 0;
}