#include <bits/stdc++.h>   using namespace std;   const int N = 100010;   int num[N], tot;   int main() {     int n, a1 = 2, a2 = 1, ans = 1;     cin >> n;     while (a1 - a2 <= n) {       if (n % (a1 - a2) == 0) ans = a1 - a2;       a1 *= 4;       a2 *= 2;     }     cout << ans << endl;     return 0;   }   