import java.util.Scanner; public class Main{ public static void main(String[] args) { //System.out.println("半角英数字の文字列"); Scanner scanner = new Scanner(System.in); String str = scanner.next(); scanner.close(); int sum = 0; for(int i = 0; i < str.length(); i++) { String s = str.substring(i,i+1); if(s.matches("[0-9]{1}")) { sum += Integer.parseInt(s); } } System.out.println(sum); } }