using System;
using System.Runtime.InteropServices;
class CodeIQ2812{
[DllImport("msvcrt",CallingConvention=CallingConvention.Cdecl)]static extern int __popcountdi2(long n);
[DllImport("msvcrt",CallingConvention=CallingConvention.Cdecl)]static extern int __sched_cpucount(int n, long[] a);
static int popcount(long n){
//return __popcountdi2(n);
return __sched_cpucount(8,new long[]{n});
//return n==0 ? 0 : popcount(n/2)+(int)(n%2);
}
static void Main(){
int n=int.Parse(Console.ReadLine());
Console.WriteLine(1<<popcount(n));
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uUnVudGltZS5JbnRlcm9wU2VydmljZXM7CiAKY2xhc3MgQ29kZUlRMjgxMnsKCVtEbGxJbXBvcnQoIm1zdmNydCIsQ2FsbGluZ0NvbnZlbnRpb249Q2FsbGluZ0NvbnZlbnRpb24uQ2RlY2wpXXN0YXRpYyBleHRlcm4gaW50IF9fcG9wY291bnRkaTIobG9uZyBuKTsKCVtEbGxJbXBvcnQoIm1zdmNydCIsQ2FsbGluZ0NvbnZlbnRpb249Q2FsbGluZ0NvbnZlbnRpb24uQ2RlY2wpXXN0YXRpYyBleHRlcm4gaW50IF9fc2NoZWRfY3B1Y291bnQoaW50IG4sIGxvbmdbXSBhKTsKCglzdGF0aWMgaW50IHBvcGNvdW50KGxvbmcgbil7CgkJLy9yZXR1cm4gX19wb3Bjb3VudGRpMihuKTsKCQlyZXR1cm4gX19zY2hlZF9jcHVjb3VudCg4LG5ldyBsb25nW117bn0pOwoJCS8vcmV0dXJuIG49PTAgPyAwIDogcG9wY291bnQobi8yKSsoaW50KShuJTIpOwoJfQoJc3RhdGljIHZvaWQgTWFpbigpewoJCWludCBuPWludC5QYXJzZShDb25zb2xlLlJlYWRMaW5lKCkpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKDE8PHBvcGNvdW50KG4pKTsKCX0KfQ==