#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    s+="c";
    for(int i=s.size(); i>-1; i--){
        if(s[i]=='c'){
            continue;
        }
        if(s[i]=='0' and s[i+1]=='c'){
            continue;
        }
        if(s[i]=='5'){
            cout<<2;
            continue;
        }if(s[i]=='2'){
            cout<<5;
            continue;
        }
        cout<<s[i];
    }
    return 0;
}
