import java.util.Scanner; import java.lang.Integer; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int number = 0; if(!s.matches(".*[0-9].*")){ System.out.println(number); }else{ String intStr= s.replaceAll("[^0-9]",""); int num = Integer.parseInt(intStr); System.out.println(sumDigits(num)); } } public static int sumDigits(int n) { int sum = 0; while (n != 0) { sum += n % 10; n /= 10; } return sum; } }