시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 712 418 338 63.774%

문제

창영이는 4와 7로 이루어진 수를 좋아한다. 창영이가 좋아하는 수 중에 K번째 작은 수를 구해 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 K(1 ≤ K ≤ 109)가 주어진다.

출력

첫째 줄에 창영이가 좋아하는 숫자 중 K번째 작은 수를 출력한다.

예제 입력 1

1

예제 출력 1

4

예제 입력 2

2

예제 출력 2

7

예제 입력 3

3

예제 출력 3

44
W3sicHJvYmxlbV9pZCI6IjI4NzciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiI0XHVjNjQwIDciLCJkZXNjcmlwdGlvbiI6IjxwPlx1Y2MzZFx1YzYwMVx1Yzc3NFx1YjI5NCA0XHVjNjQwIDdcdWI4NWMgXHVjNzc0XHViOGU4XHVjNWI0XHVjOWM0IFx1YzIxOFx1Yjk3YyBcdWM4OGJcdWM1NDRcdWQ1NWNcdWIyZTQuIFx1Y2MzZFx1YzYwMVx1Yzc3NFx1YWMwMCBcdWM4OGJcdWM1NDRcdWQ1NThcdWIyOTQgXHVjMjE4IFx1YzkxMVx1YzVkMCBLXHViYzg4XHVjOWY4IFx1Yzc5MVx1Yzc0MCBcdWMyMThcdWI5N2MgXHVhZDZjXHVkNTc0IFx1Y2Q5Y1x1YjgyNVx1ZDU1OFx1YjI5NCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVjNzkxXHVjMTMxXHVkNTU4XHVjMmRjXHVjNjI0LjxcL3A+XHJcbiIsImlucHV0IjoiPHA+XHVjY2FiXHVjOWY4IFx1YzkwNFx1YzVkMCBLKDEgJmxlOyBLICZsZTsgMTA8c3VwPjk8XC9zdXA+KVx1YWMwMCBcdWM4ZmNcdWM1YjRcdWM5YzRcdWIyZTQuPFwvcD5cclxuIiwib3V0cHV0IjoiPHA+XHVjY2FiXHVjOWY4IFx1YzkwNFx1YzVkMCBcdWNjM2RcdWM2M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