#include using namespace std; using ll = long long; int main() { ll N; cin >> N; ll M = N; int cnt=0; while(N>0){ if(N%2 == 1){ cnt++; } N/=2; } cout << M-(1LL<