import java.util.*;

public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  }
} import java.util.*; util.* java public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  }
} Main public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  } main {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int s1 = s / 100; s1 s / 100 s 100 int s2 = (s - (s1 * 100)) / 10; s2 (s - (s1 * 100)) / 10 (s - (s1 * 100)) s (s1 * 100) s1 100 10 int s3 = (s - (s1 * 100) - (s2 * 10)); s3 (s - (s1 * 100) - (s2 * 10)) s - (s1 * 100) - (s2 * 10) s (s1 * 100) s1 100 (s2 * 10) s2 10 System.out.println(s1 + s2 + s3) System.out.println System.out System System.out s1 + s2 + s3 s1 + s2 + s3 s1 s2 s3 String[] args args public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  }
} public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  }
} Main
import java.util.*;

public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int s = sc.nextInt();
    
    int s1 = s / 100;
    int s2 = (s - (s1 * 100)) / 10;
    int s3 = (s - (s1 * 100) - (s2 * 10));
    
    System.out.println(s1 + s2 + s3);
  }
}