import java.util.Scanner; public class Exercises7{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int sum = 0; String str = sc.next(); String[] strs = str.split("", 0); for(int n = 0; n < strs.length; n++){ // boolean flag = isNumber(strs[n]); if (isNumber(strs[n])){ int num = Integer.parseInt(strs[n]); sum += num; } } System.out.println(sum); } public static boolean isNumber(String num){ try{ int n = Integer.parseInt(num); return true; }catch (NumberFormatException e){ return false; } } }