#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
bool b;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
while(cin>>s){
b=false;
int l=s.length()-1;
for(int i=l;i+1;i--){
if(s[i]=='0')s[i]='9'; //借位
else{
s[i]--;
break;
}
}
for(char&c:s){ //去除前方的0並輸出
if(c-'0')b=true;
if(b)cout<<c;
}
cout<<'\n';
}
return 0;
}