#!/usr/bin/python
import sys,ctypes
if sys.version_info[0]>=3:
raw_input=input
xrange=range
if sys.platform=='linux':
libc=ctypes.cdll.LoadLibrary('libc.so.6')
popcount=lambda n:libc.__sched_cpucount(ctypes.sizeof(ctypes.c_long),(ctypes.c_long*1)(n))
elif sys.platform=='darwin':
libc=ctypes.cdll.LoadLibrary('libSystem.dylib')
popcount=lambda n:libc.__popcountdi2(n)
else:
popcount=lambda n:0 if n==0 else popcount(n/2)+n%2
print(1<<popcount(int(raw_input())))
IyEvdXNyL2Jpbi9weXRob24KaW1wb3J0IHN5cyxjdHlwZXMKaWYgc3lzLnZlcnNpb25faW5mb1swXT49MzoKCXJhd19pbnB1dD1pbnB1dAoJeHJhbmdlPXJhbmdlCgppZiBzeXMucGxhdGZvcm09PSdsaW51eCc6CglsaWJjPWN0eXBlcy5jZGxsLkxvYWRMaWJyYXJ5KCdsaWJjLnNvLjYnKQoJcG9wY291bnQ9bGFtYmRhIG46bGliYy5fX3NjaGVkX2NwdWNvdW50KGN0eXBlcy5zaXplb2YoY3R5cGVzLmNfbG9uZyksKGN0eXBlcy5jX2xvbmcqMSkobikpCmVsaWYgc3lzLnBsYXRmb3JtPT0nZGFyd2luJzoKCWxpYmM9Y3R5cGVzLmNkbGwuTG9hZExpYnJhcnkoJ2xpYlN5c3RlbS5keWxpYicpCglwb3Bjb3VudD1sYW1iZGEgbjpsaWJjLl9fcG9wY291bnRkaTIobikKZWxzZToKCXBvcGNvdW50PWxhbWJkYSBuOjAgaWYgbj09MCBlbHNlIHBvcGNvdW50KG4vMikrbiUyCgpwcmludCgxPDxwb3Bjb3VudChpbnQocmF3X2lucHV0KCkpKSk=