Translating pebbles#2918

Translating pebbles

2 seconds
256 megabytes
Easy

Sonya enjoys moving pebbles between piles. Initially, she has piles. Sometimes, she selects a pair of piles and moves the smaller pile into the larger one. If the piles are equal in size, Sonya asks her brother which pile to move. Determine the maximum number of pebbles she might have to move in any scenario.

Input

You are given a single number (1 \leq N \leq 10000).

Output

Output a single number — the answer to the problem.

Examples

Example 1

Loading
Loading