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);
}
int length = (int) (Math.log10(number) + 1);
int numOfDigits = ((int) Math.floor(Math.log10(number))) + 1