Time

12:48:54
23 May 2012
Version for print

The Cost of the K-dominoes

prb51   The worker of the department of the technical control liked to make with rejects the “dominoes” which have identical values. The enterprise which produced K-dominoes did not know it. It got always claims acted on the sum which equaled to the cost of the K-“dominoes”.

   The cost of K-“dominoes” was equal to the quantity of the “dominoes” in the set which buyer bought. The worker of the DTC made with rejects not only the “dominoes” which have identical values and some more but not more than half then the quantity of the “dominoes” which he exactly made with rejects because he did not want to be laid off. You have to indicate which set of the K-dominoes buyer bought. You know the sum of claim which got the enterprise.


Specifications

   Input

   A one number S is a sum of claim, which the enterprise got, S2000000000.

   Output

   A one number is an index K of the K-“dominoes” which buyer bought.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 5
Complexity: 18% 85/104

Example

Example input

21

Example output

6


← The Number which Cuts Problems The Cheese for Anfisa →