#include <bits/stdc++.h>
using namespace std;
const int MAXN=1e5+5;
int a[MAXN];
int k;
int main()
{
char ch=getchar();
while(ch>='0'&&ch<='9'){
a[k++]=ch-'0';
ch=getchar();
}
for(int i=0;i<k/2;i++){
int temp=a[i];
a[i]=a[k-i-1];
a[k-i-1]=temp;
}
for(int i=0;i<k;i++)
a[i]*=2;
for(int i=0;i<k;i++){
if(a[i]>=10){
a[i+1]+=a[i]/10;
a[i]%=10;
if(i==k-1)
k++;
}
}
if(a[0])
a[0]-=1;
else{
int i=0;
while(a[i]==0){
a[i]=9;
i++;
}
a[i]-=1;
}
for(int i=k-1;i>=0;i--){
cout<<a[i];
}
return 0;
}