import math

number = 123456789

################################################
#               First Algorithm                #
################################################
# It uses the fact that the base 10 logarithm  #
# of a number besides zero is roughly one less #
# than its number of digits.                   #
################################################

s = " First Algorithm: "
if number != 0:
    s += str(int(math.log(number, 10)) + 1)
else:
    s += str(1)
print s

################################################
#              Second Algorithm                #
################################################
# It divides a number by ten until it is equal #
# to zero. The number of divisions performed   #
# is equal to its number of digits.            #
################################################

count = 0 
while number != 0:
    count += 1
    number /= 10
print "Second Algorithm: " + str(count)