**
**

There is a prison with 100 cells inside it. Cells are numbered from 1 to 100 and every cell is occupied by one prisoner only. One day jailer decides to release some of the prisoners and for this he defines an algorithm of 100 steps which follows:

Step 1 Reverse the position of all the cells which are divisible by 1.

Step 2 Reverse the position of all the cells which are divisible by 2.

Step 3 Reverse the position of all the cells which are divisible by 3.

………

……………….

……………………………..

Step 99 Reverse the position of all the cells which are divisible by 99.

Step 100 Reverse the position of all the cells which are divisible by 100.

Initially all the cells are closed. After executing all these steps, prisoners of all the cells which remain open are released.

There are many islands on earth for which we do not have much information, or sometime we do not have any information about those islands. On such an island, which uses a system of S digits (S ≠ 10) to write the numbers, selling price of a goat is Rs 1,143. Parul bought a goat and paid the shopkeeper Rs 1,150. Now shopkeeper returned Parul Rs 5. How many digits are used to write the numbers in that system?