아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Heximal

시간 제한5초메모리 제한1024 MB

요약
최대 50만 자리의 십진 정수가 주어질 때, 이를 6진법으로 나타냈을 때의 자릿수를 구한다.
난이도

보통10점 중 5점

유형
수학, 문자열, 정수론, 구현
정답자
아직 제출이 없습니다

문제

The base-6 numeral system is also called the heximal numeral system. We say a string h_kh_k−1⋯h_1h_0h\_kh\_{k-1} \cdots h\_1h\_0 is a heximal number if h_i∈0,1,2,3,4,5h\_i ∈ \\{0, 1, 2, 3, 4, 5\\} for every i∈0,1,…,ki ∈ \\{0, 1, \dots , k\\} and h_k=0h\_k = 0 implies k=0k = 0. The value represented by h_kh_k−1⋯h_1h_0h\_kh\_{k-1} \cdots h\_1h\_0 in the heximal numeral system is ∑k_i=0h_i6i\sum^{k}\_{i=0}{h\_i6^i}. For example, the value of the heximal number 1234512345 equals the value of the decimal number 1865=1×64+2×63+3×62+4×6+51865 = 1 × 6^4 + 2 × 6^3 + 3 × 6^2 + 4 × 6 + 5.

Harry asks you to convert a very large base-10 number NN 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=1865N = 1865, then you just need to tell Harry the length of the conversion result is 55.

입력

The input contains exactly one integer NN in decimal.

출력

Output the length of the base-6 representation of NN.

제한

  • 0≤N<105000000 ≤ N < 10^{500000}.

예제3

  1. 예제 1

    입력
    1865
    
    예상 출력
    5
    
  2. 예제 2

    입력
    6
    
    예상 출력
    2
    
  3. 예제 3

    입력
    5
    
    예상 출력
    1