n = int(input())

while n % 10 == 0:
    n //= 10

s1 = [1, 3, 4, 6, 7, 8, 9, 0]
s = []

while n != 0:
    s.append(n%10)
    n //= 10
print(s)
for i in range(len(s)):
    if s[i] in s1:
        print(s[i], sep = '', end='')
    elif s[i] == 2:
        print(5, sep = '', end='')
    else:
        print(2, sep = '', end='')