Among many of the Catland club kittens it is important to
keep a paw on the pulse of the latest fashions and trends in
order to stay hip. When a new number is discovered in Catland,
its coolness is primarily determined by its
meow
factor. For a positive integer
, its meow factor is the largest
integer
such that
is evenly divisible by
nine times (once for
each life of a cat). We say that
is divisible by
nine times if, starting with
, you can divide it by
without a remainder,
take the result of the division and again divide it by
without a remainder,
and so on, dividing by
nine times in total.
While some cats are naturally chic and have an innate
ability to see the meow factor of numbers, others who struggle
to stay in vogue can not even tell the difference between
and (the former clearly having a
higher meow factor). Can you help those poor unfortunate cats
lacking a sense of style, by writing a program to determine the
meow factor of a number?
Input
The input contains a single integer ().
Output
Output the meow factor of .
Sample Input 1 |
Sample Output 1 |
3584
|
2
|
Sample Input 2 |
Sample Output 2 |
4711
|
1
|