Forbidden Zero

Given a positive integer n with no digit 0, find the next integer in increasing order that also contains no digit 0.

Medium4MathImplementationBrute forceSimulationInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

You are writing the positive integers in increasing order, starting from 1. You have never learned the digit 0, so you skip every number that contains a 0 in any position. The first ten integers you write are 1, 2, 3, 4, 5, 6, 7, 8, 9, and 11.

You have just written the integer nn, which contains no digit 0. Find the next integer you will write.

Input

The first line contains the integer nn (1n9999991 \le n \le 999999).

The integer nn contains no digit 0.

Output

Print the next integer you will write on the first line.