Digits $4$ and $7$ are lucky, while all others are unlucky. An integer is lucky if it contains only lucky digits in decimal notation. We would like to know the $K$-th lucky positive integer.
Input
The first and only line of input contains a positive integer $K$ ($1 \le K \le 10^9$).
Output
The first and only line of output must contain the $K$-th lucky positive integer.
Example 1
Input
1
Output
4
Example 2
Input
2
Output
7
Example 3
Input
3
Output
44
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.