Problem M. Mountain

Author:Евгений Татаринов, Игорь Блинов   Time limit:1 sec
Input file:Standard input   Memory limit:256 Mb
Output file:Standard output  

Statement

The mountain is represented by a binary heap with n vertices, there is also a number k, which represents the sum of distances between all pairs of vertices. Given the value of k, find n.

In this context, a binary heap is an undirected binary tree that satisfies the following conditions:

For example, a binary heap with 4 vertices:

Input format

The input consists of a single line containing a natural number k.

Output format

Output n.

Constraints

0 ≤ k ≤ 1018

Пояснение к примеру

The distance between the 1st and 2nd vertices is 1. The distance between the 1st and 3rd vertices is 1. The distance between the 1st and 4th vertices is 2. The distance between the 2nd and 3rd vertices is 2. The distance between the 2nd and 4th vertices is 1. The distance between the 3rd and 4th vertices is 3. The sum of all distances is 1 + 1 + 2 + 2 + 1 + 3 = 10.

Sample tests

No. Standard input Standard output
1
10
4

0.083s 0.010s 15