Problems
10049 - Binary Tree
SUBMIT PROBLEM

Binary Tree

Time Limit: 0.5 sec

 

The Problem

Binary tree is a special kind of a tree in which nodes have at most 2 children (left-child and right-child).

When a tree of height X has all nodes filled from level 0 to X-1, and the leaf nodes at the Xth level are filled from the left-most position, then the tree is called a complete binary tree. And if a tree of height X is a complete binary tree, and all leaf nodes at the Xth level are filled, the tree is called a full binary tree.

 

 

You will be given the total number of leaf nodes. Your task is to find Xth level number of that tree.

 

Example

Total Number of leaf node = 4

The Xth level number = 2

 

The Input

The Input file contains several lines. Each line contains a single integer number N (1<=N<=36028797018963968). Input is terminated by EOF.

 

The Output

For each line of input output will contain the level number of that tree in a separate line.

 

Sample Input

4

16

 

Sample Output

2

4

 

 

 

Online Practice Contest 2 [School & College Level]

Problem Setter: Samia Safa Ahmed