import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class No289 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader((new InputStreamReader(System.in))); char[] chr= br.readLine().toCharArray(); //toCharArray()はString型からchar型の配列にできる int sum = 0; for (int i = 0; i< chr.length; i++){ /*Character.isDigit(chr)でchrが数値かチェック*/ if (Character.isDigit(chr[i])){ /*CharacterクラスのgetNumericVakue(char)でchar型をint型に変換*/ sum += Character.getNumericValue(chr[i]); } } System.out.println(sum); } }