Recently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of *k* + 1 consecutive ones, and then *k* consecutive zeroes.

Some examples of beautiful numbers: 
 -  1<sub class="lower-index">2</sub> (1<sub class="lower-index">10</sub>); -  110<sub class="lower-index">2</sub> (6<sub class="lower-index">10</sub>); -  1111000<sub class="lower-index">2</sub> (120<sub class="lower-index">10</sub>); -  111110000<sub class="lower-index">2</sub> (496<sub class="lower-index">10</sub>). 
More formally, the number is beautiful iff there exists some positive integer *k* such that the number is equal to (2<sup class="upper-index">*k*</sup> - 1) * (2<sup class="upper-index">*k* - 1</sup>).

Luba has got an integer number *n*, and she wants to find its greatest beautiful divisor. Help her to find it!
The only line of input contains one number *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number Luba has got.
none
3
1
992
496
81142
1
76920
120
2016
2016
1
1
6
6
32640
32640
12096
2016
55948
1
47262
6
22876
28
96120
120
42160
496
38304
2016
89408
8128
97920
32640
55493
1
38021
1
21445
1
100000
1
497
1
240
120
21204
6
65536
1
364
28
1024
1
36
6
28
28
14400
120
10080
2016
9
1
2
1
42
6
83160
120
65534
1
1026
6
1025
1
1027
1
2018
1
2020
1
123
1
150
6
5
1
66
6
12768
28
156
6
99990
6
248
1
def beautiful_num () :
    start = 0
    while True :
        start += 1
        yield ((2**start)-1)*(2**(start-1))
        
        
num = int(input())
current_greatest = 0

for x in beautiful_num() :
    if x > num :
        break
    elif num%x == 0 :
        current_greatest = x
        
print (current_greatest)
        
    
        
    