#include int main(){ unsigned N, M; scanf("%u %u", &N, &M); unsigned answer = 0; if(N < 30 && M > 1U<<(N-1)){ printf("%u\n", (1U< 1){ answer += M; M = (M+1)>>1; N--; } printf("%u\n", answer + N); }