import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
} Main public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    } main {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] a = sc.next().split(""); a sc.next().split("") sc.next().split sc.next() sc.next sc "" int sum = 0; sum 0 for(String i: a){
        sum += Integer.parseInt(i);
      } String i a {
        sum += Integer.parseInt(i);
      } {
        sum += Integer.parseInt(i);
      } sum += Integer.parseInt(i) sum Integer.parseInt(i) Integer.parseInt Integer i System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
} public class Main {
    public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
      Scanner sc = new Scanner(System.in);
      String[] a = sc.next().split("");

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
}
