import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.next(); sc.close(); String regex = "[^0-9]"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(input); String inputA = m.replaceAll(""); char[] charStr = inputA.toCharArray(); int result = 0; for(char charNum : charStr){ result += Character.getNumericValue(charNum); } System.out.println(result); }// mainmethod } // class