#include<bits/stdc++.h>
using namespace std;
int a[200],t=0;
inline const void read(int *a)
{
char c=getchar();
while(c>='0'&&c<='9')
{
a[++t]=c-'0';
c=getchar();
}
}
int main()
{
//freopen("s.in.txt","r",stdin);
read(a);
a[t]--;
int k=t;
while(true)
{
if(a[k]<0)
{
a[k]+=10;
a[k-1]--;
k--;
}
else break;
}
//cout<<"t="<<t<<endl;
int l=1;
while(!a[l]) l++;
int r=l;
while(r<=t)
{
a[r+1]+=10*(a[r]%2);
a[r]=a[r]/2;
r++;
}
bool w=false;
//cout<<"l="<<l<<" t="<<t<<endl;
for(int i=l;i<=t;i++)
{//cout<<"*"<<endl;
if(!w&&a[i])
{
w=true;
cout<<a[i];
}
else
if(w)
cout<<a[i];
}
cout<<endl;
return 0;
}