Problem2317--Break Number

2317: Break Number

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Time Limit: 2 sec / Memory Limit: 256 MB

Score : 200200 points

Problem Statement

Takahashi loves numbers divisible by 22.
You are given a positive integer NN. Among the integers between 11 and NN (inclusive), find the one that can be divisible by 22 for the most number of times. The solution is always unique.
Here, the number of times an integer can be divisible by 22, is how many times the integer can be divided by 22 without remainder.
For example,
  • 66 can be divided by 22 once: 66 -> 33.
  • 88 can be divided by 22 three times: 88 -> 44 -> 22 -> 11.
  • 33 can be divided by 22 zero times.

Constraints

  • 1 ≤ N ≤ 1001N100

Input

Input is given from Standard Input in the following format:
NN

Output

Print the answer.

Sample Input Copy

7

Sample Output Copy

4

HINT

4 can be divided by 22 twice, which is the most number of times among 1122, ..., 77.

Source/Category