#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <stack>

using namespace std;

#define int unsigned long long
#define double long double

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int k, pr = 0, ch;
    cin >> k;
    while(k) {
        ch = k % 10;
        if(ch == 0 && pr == 0) {
            k /= 10;
            continue;
        }
        if(ch == 5) {
            cout << 2;
            pr = 1;
            k /= 10;
            continue;
        }
        if(ch == 2) {
            cout << 5;
            pr = 1;
            k /= 10;
            continue;
        }
        k /= 10;
        pr = 1;
        cout << ch;
    }
}
