#include<iostream>
#include<string>
using namespace std;

int main()
{
 
  int a , x = 1 , total = 0 , total1 = 0;;
  char b;

  while( cin >> b ){

 

   
    if( b == '0'){

      if( x != 1 ) total = total * 10 ;
      else   total = total + 0;
      x++;

    }
    
    
    else  if( b == '1'){

      if( x != 1 )  total = total * 10 + 1 ;
      else   total = total + 1;
      x++;
    }
    
    else  if( b == '2'){
      
      if( x != 1 )  total = total * 10 + 2 ;
      else   total = total + 2;
      x++;
    }
    
    else  if( b == '3'){
      
      
      if( x != 1 ) total = total * 10 + 3 ;
      else   total = total + 3;
      x++;
    }
    
    else  if( b == '4'){

      if( x != 1 ) total = total * 10 + 4 ;
      else   total = total + 4;
      x++;
    }
    
    else  if( b == '5'){
      
      if( x != 1 )  total = total * 10 + 5 ;
      else   total = total + 5;
      x++;
    }
    
    else  if( b == '6'){
      
      if( x != 1 ) total = total * 10 + 6 ;
      else   total = total + 6;
      x++;
    }
    
    else  if( b == '7'){
      
      if( x != 1 ) total = total * 10 + 7 ;
      else   total = total + 7;
      x++;
    }
    
    else  if( b == '8'){
      
      if( x != 1 ) total = total * 10 + 8 ;
      else   total = total + 8;
      x++;
    }
    
    else  if( b == '9'){
      
      if( x != 1 )  total = total * 10 + 9 ;
      else   total = total + 9;
      x++;
    }
    
    else  {

      x = 1;
      total1 = total1 + total;

      total = 0;
    
    }

  }

  cout << total1 << endl;;

  return 0;
}