#include <stdio.h>
#include <iostream>

using namespace std;

#define LL long long

int main() {
  LL N; cin >> N;
  int bits = 0;
  
  while (N != 0) {
    N >>= 1;
    bits++;
  }

  cout << (1l << (bits - 1)) << endl;
}