n = int(input()) print(bin(n).count('1') * pow(2, bin(n).count('1') - 1))