import java.util.Scanner; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { int answer = 0; Scanner scanner = new Scanner(System.in); String s = scanner.next(); Pattern pattern = Pattern.compile("^[0-9]+$"); for (char c : s.toCharArray()) { String sOfC = String.valueOf(c); if (pattern.matcher(sOfC).matches()) { int i = Integer.parseInt(sOfC); answer += i; } } System.out.println(answer); } }