시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 9 6 3 50.000%

문제

홀짝 수열은 1,2,4,5,7,9,10,12,14,16,17로 시작하는 증가하는 자연수 수열이다. 홀짝 수열은 1개의 홀수, 2개의 짝수, 3개의 홀수 이런식으로 이어진다. 이 수열의 N번째 원소를 출력한다.

입력

첫째 줄에 N(1 ≤ N ≤ 10100)이 주어진다.

출력

첫째 줄에 홀짝 수열의 N번째 원소를 출력한다.

예제 입력 1

1

예제 출력 1

1

예제 입력 2

4

예제 출력 2

5
W3sicHJvYmxlbV9pZCI6IjExODM0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVkNjQwXHVjOWRkIiwiZGVzY3JpcHRpb24iOiI8cD5cdWQ2NDBcdWM5ZGQgXHVjMjE4XHVjNWY0XHVjNzQwIDEsMiw0LDUsNyw5LDEwLDEyLDE0LDE2LDE3XHViODVjIFx1YzJkY1x1Yzc5MVx1ZDU1OFx1YjI5NCBcdWM5OWRcdWFjMDBcdWQ1NThcdWIyOTQgXHVjNzkwXHVjNWYwXHVjMjE4IFx1YzIxOFx1YzVmNFx1Yzc3NFx1YjJlNC4gXHVkNjQwXHVjOWRkIFx1YzIxOFx1YzVmNFx1Yzc0MCAxXHVhYzFjXHVjNzU4IFx1ZDY0MFx1YzIxOCwgMlx1YWMxY1x1Yzc1OCBcdWM5ZGRcdWMyMTgsIDNcdWFjMWNcdWM3NTggXHVkNjQwXHVjMjE4IFx1Yzc3NFx1YjdmMFx1YzJkZFx1YzczY1x1Yjg1YyBcdWM3NzRcdWM1YjRcdWM5YzRcdWIyZTQuIFx1Yzc3NCBcdWMyMThcdWM1ZjRcdWM3NTggTlx1YmM4OFx1YzlmOCBcdWM2ZDBcdWMxOGNcdWI5N2MgXHVjZDljXHViODI1XHVkNTVjXHViMmU0LjxcL3A+XHJcbiIsImlucHV0IjoiPHA+XHVjY2FiXHVjOWY4IFx1YzkwNFx1YzVkMCBOKDEgJmxlOyBO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