进制转换转换为8进制;;;
#include <cstdlib>
#include<cmath>
#include <iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
// freopen("1.txt","w",stdout);
long n,x,ans=0,xx;
while(~scanf("%ld",&n)&&n)
{
x=0;
xx=n;
char str[19];
ans=0;
int len;
while(n/10)
{
sprintf(str,"%ld",n);
len=strlen(str)-1;
x=n/((long)pow(10.0,len));
if(x<3)ans+=x*((long) pow(8.0,len));
else if(x<8){ans+=(x-1)*((long)pow(8.0,len));}
else {
ans+=(x-2)*((long)pow(8.0,len));
}
n=n-x*((long)pow(10.0,len));
}
if(n<3)
ans+=n;
else if(n<8)ans+=(n-1);
else
ans+=(n-2);
printf("%ld: %ld\n",xx,ans);
}
return 0;
}