Height of the left tree#2920

Height of the left tree

2 seconds
256 megabytes
Medium

The potential of a vertex in a suspended binary tree is the shortest distance to a vertex with fewer than two children. A tree is called left if, for each vertex, the left child has a potential not less than that of the right child. Furthermore, there must not be any vertex that has a right child but no left child.

The height of a tree is the number of vertices on the longest path from the root to a leaf.

Given the number of vertices , determine the height of both the tallest and the shortest left tree.

Input

A single integer is given: the number of vertices in the tree (1 \leq N \leq 10^9).

Output

Output two integers: the height of the tallest left tree and the height of the shortest left tree.

Examples

Example 1

Loading
Loading