시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 570 482 423 88.309%

문제

희연이는 스웨덴으로 이사하여 현재 학교를 다니고 있다. 1학년 교육과정은 중국에서 배웠고, 스웨덴과 중국 두 나라의 교육과정은 완전히 다르다. 희연이는 수학을 좋아한다. 하지만 지금은... 선생님은 칠판에 뺄셈을 설명하고 있어서 희연이는 수업에 흥미가 없다. 칠판에 있는 수들을 역 이진법으로 나타낸 수들로 같은 계산을 수행하는 것이 가능할까? 희연이는 몽상을 하며 시간을 보냈고, 머릿속으로 역 이진법 표시 프로그램을 구상하기 시작했다. 수업이 끝나는대로 희연이는 집에가서 컴퓨터에 그것들을 적을 것이다.

당신이 할 일은 역 이진법 프로그램을 작성하는 것이다. 예를 들어 13을 2진법으로 나타면 1101이고, 이것을 뒤집으면 1011이 된다. 이 수를 다시 10진법으로 나타내면 11이다.

입력

입력은 한 줄에 정수 N이 주어진다. (N은 1보다 크거나 같고, 1,000,000,000보다 작거나 같다.)

출력

입력받은 N을 2진법으로 나타낸 뒤 뒤집어, 다시 10진법으로 나타낸 수를 출력한다.

예제 입력 1

13

예제 출력 1

11

예제 입력 2

47

예제 출력 2

61
W3sicHJvYmxlbV9pZCI6IjExMTc5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiMlx1YzljNFx1YzIxOCBcdWI0YTRcdWM5ZDFcdWFlMzAiLCJkZXNjcmlwdGlvbiI6IjxwPlx1ZDc2Y1x1YzVmMFx1Yzc3NFx1YjI5NCBcdWMyYTRcdWM2ZThcdWIzNzRcdWM3M2NcdWI4NWMgXHVjNzc0XHVjMGFjXHVkNTU4XHVjNWVjIFx1ZDYwNFx1YzdhYyBcdWQ1NTlcdWFkNTBcdWI5N2MgXHViMmU0XHViMmM4XHVhY2UwIFx1Yzc4OFx1YjJlNC4gMVx1ZDU1OVx1YjE0NCBcdWFkNTBcdWM3MjFcdWFjZmNcdWM4MTVcdWM3NDAmbmJzcDtcdWM5MTFcdWFk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