The Champernowne constant is an irrational number. After the decimal point it writes every positive integer in increasing order, one right after another, so the constant is 0.123456789101112131415... .
You are given a sequence S of decimal digits. Write a program that computes the position of the first occurrence of S in the digits after the decimal point. The digit right after the decimal point is position 1.
Input
The input holds several test cases. Each line contains one digit sequence. The last line of the input contains only #.
Every sequence has at least one digit and its length is at most 100.
Output
For each sequence, print the position described above as one decimal integer on its own line. You may assume every output value is less than 1016.