410244: GYM103990 H Heximal

Memory Limit:1024 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Heximaltime limit per test20.0 smemory limit per test1024 megabytesinputstandard inputoutputstandard output

The base-6 numeral system is also called the heximal numeral system. We say a string $$$h_kh_{k-1}\cdots h_1h_0$$$ is a heximal number if $$$h_i\in\{0, 1, 2, 3, 4, 5\}$$$ for every $$$i\in \{0,1,\dots,k\}$$$ and $$$h_k=0$$$ implies $$$k=0$$$. The value represented by $$$h_kh_{k-1}\cdots h_1h_0$$$ in the heximal numeral system is $$$\sum\limits_{i=0}^kh_i6^i$$$. For example, the value of the heximal number $$$12345$$$ equals the value of the decimal number $$$1865=1\times 6^4+2\times 6^3+3\times 6^2+4\times 6+5$$$.

Harry asks you to convert a very large base-10 number $$$N$$$ to base-6. Since the conversion result can be very long, it is too hard for Harry to verify the result by himself. So, you just need to tell Harry the length of the conversion result. For example, if $$$N=1865$$$, then you just need to tell Harry the length of the conversion result is $$$5$$$.

Input

The input contains exactly one integer $$$N$$$ in decimal.

$$$0\le N< 10^{500000}$$$.

Output

Output the length of the base-6 representation of $$$N$$$.

ExamplesInput
1865
Output
5
Input
6
Output
2
Input
5
Output
1

加入题单

算法标签: