import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a=sc.nextInt();
    System.out.println(a%10+(a/10)%10+(a/100)%10);
  }
} import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a=sc.nextInt();
    System.out.println(a%10+(a/10)%10+(a/100)%10);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a=sc.nextInt();
    System.out.println(a%10+(a/10)%10+(a/100)%10);
  } main {
    Scanner sc = new Scanner(System.in);
	int a=sc.nextInt();
    System.out.println(a%10+(a/10)%10+(a/100)%10);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println(a%10+(a/10)%10+(a/100)%10) System.out.println System.out System System.out a%10+(a/10)%10+(a/100)%10 a%10+(a/10)%10+(a/100)%10 a%10 a 10 (a/10)%10 (a/10) a 10 10 (a/100)%10 (a/100) a 100 10 String[] args args
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a=sc.nextInt();
    System.out.println(a%10+(a/10)%10+(a/100)%10);
  }
}