import java.util.Scanner;
public class Sum {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter a number between 0 and 1000");
int integer = input.nextInt();
if(integer>0 && integer<10)
{
System.out.println("The sun of the digits is " + integer);
}
else if(integer>=10 && integer<100)
{
int a = integer%10;
int b = integer/10;
int sum = a+b;
System.out.println("The sun of the digits is " + sum);
}
else if(integer>=100 && integer<=999)
{
int a = integer%10;
int b = integer/10%10;
int c = integer/100;
int sum = a+b+c;
System.out.println("The sun of the digits is " + sum);
}
}
}