#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

string  sum = "0";

string pl(string a, string b){
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());

  int status = 0;

  for(int i = 0; i < a.length(); i++){
    if(status == 1){
      a[i]++;
      status = 0;
    }
    
    if((int)a[i]-48 + (int)b[i]-48 >= 10){
      status = 1;
      a[i]+=(int)b[i]-58;
    }else{
      a[i]+=(int)b[i]-48;
    }
  }

  if(status == 1) a += "1";
  reverse(a.begin(), a.end());
  return a;
}

string make(string in){
  int a;
  if(sum.length() > in.length()){
    a = sum.length()-in.length();
    reverse(in.begin(), in.end());
    for(int i = 0; i < a; i++){
      in+="0";
    }
    reverse(in.begin(), in.end());
  }else{
    a = in.length() - sum.length();
    reverse(sum.begin(),sum.end());
    for(int i = 0; i < a; i++){
      sum+="0";
    }
    reverse(sum.begin(),sum.end());
  }

  return pl(sum,in);
}

int main(){

  vector<string> V;
  char in;
  string s = "\0";

  while(cin >> in){
    if(in >= '0' && in<= '9'){
      s += in;
    }else{
      if(s.length() > 0){
	V.push_back(s);
	s = "\0";
      }
    }
  }

  if(s != "\0") V.push_back(s);

    for(int i = 0; i < V.size(); i++){
      sum = make(V[i]);
    }

    cout << sum << endl;

  return 0;
}