n = int(input())
flag = 0
k = ''
while n > 0:
    if n % 10 == 0 and flag == 0:
        n = n // 10
        continue
    if n % 10 != 0:
        flag = 1
        if n % 10 == 5:
            k += str(2)
        elif n % 10 == 2:
            k += str(5)
        else:
            k += str(n % 10)
    n //= 10
print(k)
