import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
System.out.println();
@SuppressWarnings("resource")
Scanner input= new Scanner(System.in);
int number=input.nextInt();
int A=number/100;
int B=number%100/10;
int C=number%100%10;
int H=A+B+C;
System.out.println(H);
}
}
public class Main {
public static void main(String[] args)
{
System.out.println();
@SuppressWarnings("resource")
Scanner input= new Scanner(System.in);
int number=input.nextInt();
int A=number/100;
int B=number%100/10;
int C=number%100%10;
int H=A+B+C;
System.out.println(H);
}
}