import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; class Yukicoder { static public void main(String[] args) { Scanner scanner = new Scanner(System.in); String S = scanner.next(); if (S.isEmpty() || S.length() > 10000) System.exit(1); Pattern p = Pattern.compile("\\d"); String tmp; int sum = 0; for (int i = 0; i < S.length(); i++) { tmp = S.substring(i, i+1); Matcher m = p.matcher(tmp); if (m.find()) sum += Integer.parseInt(tmp); } System.out.println(sum); } }