#include #define SIZE 1000000000000 int main(){ long in; int i,out[SIZE]; scanf("%ld\n",&in); for(i=0;in>6;i++){ out[i]=in%7; in/=7; } out[i]=in; while(i<0){ printf("%d",out[i]); i--; } printf("\n"); return 0; }