#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"please enter a number:";
cin>>a;
int b[100];
int n=0,i=0;
for(i=0;i<100;i++)
{
b[i]=a%8;
a=a/8;
n++;
if(a==0)
break;
else continue;
}
cout<<n<<endl;
for(i=n-1;i>=0;i--)
cout<<b[i];
system("PAUSE");
return 0;
}