#include #include using namespace std; #define rep(i,n) for(long long i = 0; i < (long long)(n); i++) #define all(x) (x).begin(), (x).end() #define fi first #define se second using ll = long long; using vll = vector; using vvll = vector; using P = pair; static const long long mo = 1e9+7; int main(void) { ll n; cin >> n; assert(0<=n&&n<=1000000000000000000ll); string s; while (n) s += char(n % 2), n >>= 1; reverse(all(s)); ll dp[100][2][2][2][2] = {}; // dp[i][j][h][k][l] = // i桁目まで見て、 // n未満が確定していて(j)、 // X t = {P(0,0), P(0,1), P(1,0), P(1,1) }; // n未満確定していたらyは何でも選べる、そうでなければsに束縛 if (!j) if (s[i] == 0) t.erase(P(0, 1)), t.erase(P(1, 1)); // X