	#include<bits/stdc++.h>
	#define en "\n"
	#define s second
	#define f first
	#define int long long
	#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
	#define vi vector<int>
	#define vii vector<pair<int,int> >
	#define rall(x) x.rbegin(), x.rend()
	#define pb push_back
	#define loop(a) for(int i = 0; i < a; i++)
	#define loopv(i,a) for (int i = 0; i < a; i++)
	#define all(x) (x).begin(), (x).end()
	#define prDouble(x) cout << fixed << setprecision(10) << x
	#define goog(tno) cout << "Case #" << tno <<": "
	using namespace std;
	 
	int gcd (int a, int b) {
	    while (b) {
	        a %= b;
	        swap (a, b);
	    }
	    return a;
	}
	int lcm (int a, int b) {
	    return a / gcd (a, b) * b;
	}
	
	signed main()
	{
	    fast_io;
	    int k; cin>>k;
	    vi ans;
	    while(k%10==0){
	    	k/=10;
	    }
	    while(k){
	    	int x = k%10;
	    	if(x==5){
	    		ans.pb(2);
	    	}
	    	else if(x==2){
	    		ans.pb(5);
	    	}
	    	else{
	    		ans.pb(x);
	    	}
	    	k/=10;
	    }
	    for(int i=0; i<ans.size(); i++){
	    	cout<<ans[i];
	    }
	    
	    
	}