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)
aW1wb3J0IG1hdGgKCm51bWJlciA9IDEyMzQ1Njc4OQoKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiMgICAgICAgICAgICAgICBGaXJzdCBBbGdvcml0aG0gICAgICAgICAgICAgICAgIwojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyBJdCB1c2VzIHRoZSBmYWN0IHRoYXQgdGhlIGJhc2UgMTAgbG9nYXJpdGhtICAjCiMgb2YgYSBudW1iZXIgYmVzaWRlcyB6ZXJvIGlzIHJvdWdobHkgb25lIGxlc3MgIwojIHRoYW4gaXRzIG51bWJlciBvZiBkaWdpdHMuICAgICAgICAgICAgICAgICAgICMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCgpzID0gIiBGaXJzdCBBbGdvcml0aG06ICIKaWYgbnVtYmVyICE9IDA6CiAgICBzICs9IHN0cihpbnQobWF0aC5sb2cobnVtYmVyLCAxMCkpICsgMSkKZWxzZToKICAgIHMgKz0gc3RyKDEpCnByaW50IHMKCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwojICAgICAgICAgICAgICBTZWNvbmQgQWxnb3JpdGhtICAgICAgICAgICAgICAgICMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjI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