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; for(int i = 0;i < s.length(); i++){ if(Character.isDigit(s.charAt(i))){ String intStr = s.replaceAll("[^0-9]",""); number = Integer.parseInt(intStr); } } System.out.println(sumDigits(number)); } public static int sumDigits(int n) { int sum = 0; while (n != 0) { sum += n % 10; n /= 10; } return sum; } }