Under construction

Still being built. Things may change

Watermelon Game

Interview

Time limit1sMemory limit1024 MB

Summary
Given N and K cherries, find how many level N watermelons can be made by merging two equal-level fruits into the next level.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

A level 1 fruit is a cherry, and a level NN fruit is a watermelon.

You can consume two level ii fruits to make one level i+1i+1 fruit. (1≤i≤N−1)(1 \leq i \leq N-1)

Find the maximum number of watermelons you can make from KK cherries.

Input

The first line contains two integers NN and KK, separated by a space. (2≤N≤30;1≤K≤109)(2 \leq N \leq 30; 1 \leq K \leq 10^9)

Output

Print the maximum number of watermelons that can be made on the first line.

Examples1

  1. Example 1

    Input
    3 10
    
    Expected output
    2