#include<iostream>
#include<cstdio>
#include<cstring>
#include<string.h>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<sstream>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<30
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int famine[10000];

void add(string s){
  reverse(s.begin(),s.end());
  bool plus = false;
  int A,B,C,i;
  for(i=0;i<10000;i++){
    A = i<s.length()?s[i]-'0':0;
    B = famine[i];
    C = plus?1:0;
    plus = A+B+C>=10?true:false;
    famine[i] = (A+B+C)%10;
  }    
  bool cle = false;
 
}

int main(){
  string s;
  int sam = 0,val;
  bool config;

  for(int i=0;i<10000;i++)famine[i] = 0;
  while(getline(cin,s,'\n')){
    for(int i=0;i<s.length();i++)if(!isdigit(s[i]))s[i] = ' '; 
    stringstream ss;
    for(ss<<s;ss>>val;){
      stringstream sss;
      sss << val;
      add(sss.str());
    }    
  }
  bool cle = false;
  for(int i=10000;i>=0;i--){
    if(!cle && famine[i] == 0)continue;
    cle = true;
    cout << famine[i];
  }
  cout << endl;
return 0;
}