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(); String intStr = s.replaceAll("[^0-9]",""); Integer number = Integer.valueOf(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; } }