#include<iostream>
#include<stdio.h>
#include<ctype.h>
#include<string>
#include<cmath>
#include<math.h>
#include<vector>
#include<stdlib.h>
#include<algorithm>

using namespace std;

#define OUT cout <<
#define IN cin >>
#define E << endl;
#define FOR(i,a,b) for(int i = a;i < b;i++)
#define RFOR(i, a, b) for(int i = a;i >= b;i--)

string str;
int sum;

int check;

void input(){
	IN str;
}

int main(){
	while(IN str){
		RFOR(i, str.size() - 1, 0){
			if(isdigit(str[i]) > 0){
				if(check > 0){
					sum += ((int)str[i] - '0') * pow(10, check);	
				}
				else{
					sum += ((int)str[i] - '0');		
				}
				check++;
			}
			else{
				check = 0;
			}
		}
		check = 0;
	}
	
	OUT sum E
}