count number of digits program in java