import java.io.*; public class Sum { public static void main (String[] args) throws IOException{ try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){ String numString = new String(in.readLine()); in.close(); String[] array = numString.split(""); int sum = 0; for (int i = 0; i < numString.length(); i++){ sum += Integer.parseInt(array[i]); } System.out.println(sum); } catch (IOException e){ // 例外 } } }