e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Ones and sevens

Ones and sevens

Find the n-th number of the increasing sequence of positive integers:

1 7 11 17 71 77 111 117 171 177 711 717..

Input

One positive integer n (1n107).

Output

Print thee n-th number of the given sequence.

Time limit 1 second
Memory limit 128 MiB
Input example #1
7
Output example #1
111