#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000005 #define Inf64 4000000000000000001LL int main(){ string s; cin>>s; while(true){ int ii = -1; rep(i,s.size()){ if(s[i]=='3'){ ii = i; break; } } if(ii!=-1){ for(int i=ii;i=0;i--){ if(s[i]=='0')s[i]='9'; else{ s[i]--; break; } } } while(s[0]=='0')s.erase(s.begin()); cout<