P6445 [COCI 2010/2011 #1] SRETAN
Description
It is known that $4$ and $7$ are lucky digits, and other digits are not lucky digits. If an integer contains only lucky digits in its decimal representation, then this integer is lucky. You need to find the $k$-th lucky positive integer.
Input Format
The input contains one line.
One line with one integer $k$, with the meaning as described above.
Output Format
The output contains one line.
One line with one integer, which is the answer.
Explanation/Hint
**Explanation for Sample Input/Output 1**
Because we are looking for positive integers, the first one must be the number $4$.
---
**Constraints**
For $100\%$ of the testdata, $1 \leq k \leq 10^9$.
---
**Note**
**This problem is translated from [COCI2010-2011](https://hsin.hr/coci/archive/2010_2011/) [CONTEST #1](https://hsin.hr/coci/archive/2010_2011/contest1_tasks.pdf) *T3 SRETAN*.**
Translated by ChatGPT 5