int n = 1000;
int length = (int)(Math.log10(n)+1);
//NB: only valid for n > 0
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num = input.nextInt();
int count = 0;
while (num > 0) {
num /= 10;
count++;
}
System.out.println("number of digits: " + count);
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int num = input.nextInt();
int sum = 0;
while (num > 0) {
sum += num % 10;
num /= 10;
}
System.out.println("sum of digits: " + sum);
}
int length = (int) (Math.log10(number) + 1);
int numOfDigits = ((int) Math.floor(Math.log10(number))) + 1