#!/usr/bin/env ruby

sum = 0

while line = gets
  stc = line.chomp.split('')
  ary = []

  stc.each do |chr|
    if chr =~ /^[0-9]+$/
      ary << chr.to_i
    else
      unless ary.length.zero?
        ary = ary.reverse
        (ary.length).times do |i|
          sum += ary[i] * (10 ** i)
        end
        ary = []
      end
    end
  end
end

puts sum