//#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <random>
#include <chrono>
/*
Bismillah hir rahman nir raheem
*/
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
void solve()
{
    string  n;
    cin >> n;
    for( int i = n.size()  - 2; i >= 1; i-- )
    {
        if ( n[i] != '0' )
        {
            if ( n[i] == '2')
            {
                cout >> "5";
            }
            else
            {
                if ( n[i] == '5' )
                {
                    cout << "2";
                }
                else{
                    cout << n[i];
                }
            }
        }
    }
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1; 
    while (t--)
    {
        solve();
        cout << endl;
    }
    return 0;
}