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