#499 7number N=int(input()) Se=7 i=0 while N>=Se: Se*=7 i+=1 Se//=7 Ns=[] while N>=1: Ns.append(N//Se) i-=1 # print (Se) N%=Se Se//=7 while i>0: Ns.append(0) i-=1 Nst=[str(i) for i in Ns] Nj="".join(Nst) print (Nj)