#include using namespace std; int main() { int v; cin >> v ; v = v - ((v >> 1) & 0x55555555); cout << v << '\n' ; return 0; }