#include int gcd(int a,int b){ return b?gcd(b,a%b):a; } int main(){ long long n; scanf("%lld",&n); long long org = n; int cnt = 0; while(n!=0) n /= 2, cnt += 2; int next = 0; if(org==2) cnt = 2; while(org!=0) org /= 3, next += 3; if(next