시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
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+XHVjY2FiXHVjOWY4XHVjOTA0XHVjNWQwIE4oMSAmbGU7IE4gJm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